使用 xCode 9 和 iOS 11 时状态栏下方的白色条
White bar below status bar when using xCode 9 and iOS 11
我们正在使用 RADStudio 10.1 Berlin 和 FireMonkey 为 iOS 开发应用程序。
使用 Xcode 9.1 (9B55) for iOS 11.1.2 (15B202) 构建应用程序时,我们在顶部看到一个白色条,就在状态栏下方。
即使我们根本不使用任何样式手册,也会发生这种情况。
我们的尝试
- 在较早的 iOS 版本上部署 - 没问题。
- 使用 xCode 8 编译 - 没问题。
正在 Android 部署 - 没问题。
将 'FormFactor.Devices' 从 'Desktop' 更改为 'iPad',并添加 'iPhone'。问题仍然存在,我们尝试的每个组合都给出了奇怪的白色条带 xCode 9 和 iOS 11.
我们也在 iOS 模拟器上尝试了 运行 这个,但是模拟器本身有问题。
将 属性 Border.Styling
设置为 False
。问题依旧。
将 Form.Caption 设置为空字符串。问题依旧。
我们观察到白色栏不是状态栏。状态栏在我们神秘的白色栏上方可见。
它可能是某种导航栏,不幸的是 FireMonkey 似乎没有让我们访问内置控件。
我们在 MCVE 中复制了这个。
这是Delphi代码:
unit Unit6;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
FMX.Controls.Presentation, FMX.StdCtrls, System.Actions, FMX.ActnList,
FMX.StdActns, FMX.MediaLibrary.Actions;
type
TForm6 = class(TForm)
ActionList1: TActionList;
TakePhotoFromCameraAction1: TTakePhotoFromCameraAction;
SpeedButton1: TSpeedButton;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form6: TForm6;
implementation
{$R *.fmx}
end.
这是表格 (FMX) 的代码:
object Form6: TForm6
Left = 0
Top = 0
Border.Styling = False
BorderIcons = []
ClientHeight = 480
ClientWidth = 640
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [iPad]
DesignerMasterStyle = 0
object SpeedButton1: TSpeedButton
Action = TakePhotoFromCameraAction1
Enabled = True
ImageIndex = -1
Position.X = 144.000000000000000000
Position.Y = 272.000000000000000000
Visible = True
end
object ActionList1: TActionList
Left = 64
Top = 88
object TakePhotoFromCameraAction1: TTakePhotoFromCameraAction
Category = 'Media Library'
end
end
end
那么问题来了,我们如何去掉这个奇怪的栏呢?
将 BorderStyle
设置为 none
可以解决该问题。
来自 documentation of Borderstyle:
In iOS applications, None makes your form run in fullscreen mode. With
any other value, your iOS app shows the iOS status bar
我们正在使用 RADStudio 10.1 Berlin 和 FireMonkey 为 iOS 开发应用程序。
使用 Xcode 9.1 (9B55) for iOS 11.1.2 (15B202) 构建应用程序时,我们在顶部看到一个白色条,就在状态栏下方。
即使我们根本不使用任何样式手册,也会发生这种情况。
我们的尝试
- 在较早的 iOS 版本上部署 - 没问题。
- 使用 xCode 8 编译 - 没问题。
正在 Android 部署 - 没问题。
将 'FormFactor.Devices' 从 'Desktop' 更改为 'iPad',并添加 'iPhone'。问题仍然存在,我们尝试的每个组合都给出了奇怪的白色条带 xCode 9 和 iOS 11.
我们也在 iOS 模拟器上尝试了 运行 这个,但是模拟器本身有问题。
将 属性
Border.Styling
设置为False
。问题依旧。将 Form.Caption 设置为空字符串。问题依旧。
我们观察到白色栏不是状态栏。状态栏在我们神秘的白色栏上方可见。
它可能是某种导航栏,不幸的是 FireMonkey 似乎没有让我们访问内置控件。
我们在 MCVE 中复制了这个。
这是Delphi代码:
unit Unit6;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
FMX.Controls.Presentation, FMX.StdCtrls, System.Actions, FMX.ActnList,
FMX.StdActns, FMX.MediaLibrary.Actions;
type
TForm6 = class(TForm)
ActionList1: TActionList;
TakePhotoFromCameraAction1: TTakePhotoFromCameraAction;
SpeedButton1: TSpeedButton;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form6: TForm6;
implementation
{$R *.fmx}
end.
这是表格 (FMX) 的代码:
object Form6: TForm6
Left = 0
Top = 0
Border.Styling = False
BorderIcons = []
ClientHeight = 480
ClientWidth = 640
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [iPad]
DesignerMasterStyle = 0
object SpeedButton1: TSpeedButton
Action = TakePhotoFromCameraAction1
Enabled = True
ImageIndex = -1
Position.X = 144.000000000000000000
Position.Y = 272.000000000000000000
Visible = True
end
object ActionList1: TActionList
Left = 64
Top = 88
object TakePhotoFromCameraAction1: TTakePhotoFromCameraAction
Category = 'Media Library'
end
end
end
那么问题来了,我们如何去掉这个奇怪的栏呢?
将 BorderStyle
设置为 none
可以解决该问题。
来自 documentation of Borderstyle:
In iOS applications, None makes your form run in fullscreen mode. With any other value, your iOS app shows the iOS status bar