gpt4 book ai didi

delphi - Firemonkey TFrame 对齐 = 缩放错误?

转载 作者:行者123 更新时间:2023-12-03 15:53:48 31 4
gpt4 key购买 nike

我有一个疑问。我在 firemonkey 中创建了一个框架并添加了 2 个按钮,然后在 MainForm 中添加了这个框架。

Frame.Align = Scale

在MainForm中对象Frame.Align = Client

当我编译表单并调整其大小时,框架不会缩放。

这是正常问题还是错误?

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

关于delphi - Firemonkey TFrame 对齐 = 缩放错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47456826/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com