Firemonkey TFrame Align = Scale Bug?
Firemonkey TFrame Align = Scale Bug?
我有疑问。我在 firemonkey 中创建了一个框架并添加了 2 个按钮,然后在 MainForm 中添加了这个框架。
Frame.Align = Scale
在 MainForm 中对象 Frame.Align = Client
当我编译和调整窗体大小时,框架不缩放。
这是正常问题还是bug?
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 481
ClientWidth = 627
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [Desktop]
DesignerMasterStyle = 0
inline Frame21: TFrame2
Align = Scale
Position.Y = -3.000000000000000000
Size.Width = 887.000000000000000000
Size.Height = 653.000000000000000000
Size.PlatformDefault = False
end
end
object Frame2: TFrame2
Align = Scale
Size.Width = 526.000000000000000000
Size.Height = 395.000000000000000000
Size.PlatformDefault = False
object Button1: TButton
Position.X = 80.000000000000000000
Position.Y = 40.000000000000000000
TabOrder = 0
Text = 'Button1'
end
object Button2: TButton
Position.X = 144.000000000000000000
Position.Y = 144.000000000000000000
TabOrder = 1
Text = 'Button2'
end
object Button3: TButton
Position.X = 240.000000000000000000
Position.Y = 256.000000000000000000
TabOrder = 2
Text = 'Button3'
end
end
不,框架中 Align = Scale
没有错误。您似乎只有框架本身与 Scale
.
对齐
如果您希望框架上的组件也可以缩放,您还需要分配它们 Align
属性。
这是我的表格
object Form22: TForm22
Left = 0
Top = 0
Caption = 'Form22'
ClientHeight = 200
ClientWidth = 350
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [Desktop]
DesignerMasterStyle = 0
inline Frame221: TFrame22
Align = Scale
Position.X = 16.000000000000000000
Position.Y = 14.000000000000000000
Size.Width = 320.000000000000000000
Size.Height = 171.000000000000000000
Size.PlatformDefault = False
TabOrder = 1
inherited Label1: TLabel
Position.X = 16.000000000000000000
Position.Y = 24.000000000000000000
end
inherited Button1: TButton
Position.Y = 48.857139587402340000
Size.Height = 19.193893432617190000
Size.PlatformDefault = False
end
inherited Button2: TButton
Position.Y = 48.857139587402340000
Size.Height = 19.193893432617190000
Size.PlatformDefault = False
end
inherited Rectangle1: TRectangle
Position.Y = 76.775512695312500000
Size.Height = 77.647918701171880000
end
end
end
和框架
object Frame22: TFrame22
Align = Scale
Size.Width = 320.000000000000000000
Size.Height = 196.000000000000000000
Size.PlatformDefault = False
TabOrder = 0
object Label1: TLabel
Position.X = 32.000000000000000000
Position.Y = 32.000000000000000000
Text = 'Frame here!'
end
object Button1: TButton
Align = Scale
Position.X = 16.000000000000000000
Position.Y = 56.000000000000000000
TabOrder = 1
Text = 'Button1'
end
object Button2: TButton
Align = Scale
Position.X = 216.000000000000000000
Position.Y = 56.000000000000000000
TabOrder = 2
Text = 'Button2'
end
object Rectangle1: TRectangle
Align = Scale
Position.X = 16.000000000000000000
Position.Y = 88.000000000000000000
Size.Width = 281.000000000000000000
Size.Height = 89.000000000000000000
Size.PlatformDefault = False
end
end
请注意,所有组件(TLabel
除外)的 Align
属性 设置为 Scale
。
我有疑问。我在 firemonkey 中创建了一个框架并添加了 2 个按钮,然后在 MainForm 中添加了这个框架。
Frame.Align = Scale
在 MainForm 中对象 Frame.Align = Client
当我编译和调整窗体大小时,框架不缩放。
这是正常问题还是bug?
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 481
ClientWidth = 627
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [Desktop]
DesignerMasterStyle = 0
inline Frame21: TFrame2
Align = Scale
Position.Y = -3.000000000000000000
Size.Width = 887.000000000000000000
Size.Height = 653.000000000000000000
Size.PlatformDefault = False
end
end
object Frame2: TFrame2
Align = Scale
Size.Width = 526.000000000000000000
Size.Height = 395.000000000000000000
Size.PlatformDefault = False
object Button1: TButton
Position.X = 80.000000000000000000
Position.Y = 40.000000000000000000
TabOrder = 0
Text = 'Button1'
end
object Button2: TButton
Position.X = 144.000000000000000000
Position.Y = 144.000000000000000000
TabOrder = 1
Text = 'Button2'
end
object Button3: TButton
Position.X = 240.000000000000000000
Position.Y = 256.000000000000000000
TabOrder = 2
Text = 'Button3'
end
end
不,框架中 Align = Scale
没有错误。您似乎只有框架本身与 Scale
.
如果您希望框架上的组件也可以缩放,您还需要分配它们 Align
属性。
这是我的表格
object Form22: TForm22
Left = 0
Top = 0
Caption = 'Form22'
ClientHeight = 200
ClientWidth = 350
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [Desktop]
DesignerMasterStyle = 0
inline Frame221: TFrame22
Align = Scale
Position.X = 16.000000000000000000
Position.Y = 14.000000000000000000
Size.Width = 320.000000000000000000
Size.Height = 171.000000000000000000
Size.PlatformDefault = False
TabOrder = 1
inherited Label1: TLabel
Position.X = 16.000000000000000000
Position.Y = 24.000000000000000000
end
inherited Button1: TButton
Position.Y = 48.857139587402340000
Size.Height = 19.193893432617190000
Size.PlatformDefault = False
end
inherited Button2: TButton
Position.Y = 48.857139587402340000
Size.Height = 19.193893432617190000
Size.PlatformDefault = False
end
inherited Rectangle1: TRectangle
Position.Y = 76.775512695312500000
Size.Height = 77.647918701171880000
end
end
end
和框架
object Frame22: TFrame22
Align = Scale
Size.Width = 320.000000000000000000
Size.Height = 196.000000000000000000
Size.PlatformDefault = False
TabOrder = 0
object Label1: TLabel
Position.X = 32.000000000000000000
Position.Y = 32.000000000000000000
Text = 'Frame here!'
end
object Button1: TButton
Align = Scale
Position.X = 16.000000000000000000
Position.Y = 56.000000000000000000
TabOrder = 1
Text = 'Button1'
end
object Button2: TButton
Align = Scale
Position.X = 216.000000000000000000
Position.Y = 56.000000000000000000
TabOrder = 2
Text = 'Button2'
end
object Rectangle1: TRectangle
Align = Scale
Position.X = 16.000000000000000000
Position.Y = 88.000000000000000000
Size.Width = 281.000000000000000000
Size.Height = 89.000000000000000000
Size.PlatformDefault = False
end
end
请注意,所有组件(TLabel
除外)的 Align
属性 设置为 Scale
。