Firemonkey / Delphi中的流体/动态布局 [英] Fluid/Dynamic layout in Firemonkey / Delphi
问题描述
我真正想要的是设置比例..例如..有一个上述形状占25%,另一个占75%
动态调整大小非常重要,我不想输入任何代码来实现这一点。
可以通过在表单上放置TLayout来实现 - 将对齐选项设置为alscale
然后为我的示例TPanels添加2个项目到TLayout Ie - 将对齐选项设置为alscale。将每个宽度设置为所需的比例。
创建时的形式:
Form On Resize:
可以使用'无代码 - '对于上面的图像,我刚添加了标签来显示面板宽度的大小。
希望这有助于
Paul
Let's say I want two shapes on a form sitting side by side taking up exactly 50% of the window each, which resize when the window is resized. How can I do that?
What I really want is to set things up in ratios.. eg.. Have one of the above shapes take up 25% and the other take 75%
The dynamic resizing is very important, and I don't want to have to type any code to achieve this.
Can be achieved by dropping a TLayout on the form - Setting the Align option to 'alscale'
Then adding 2 items to the TLayout I.e for my example TPanels - with align options on both set also to 'alscale'. Set the widths of each to the ratio you want.
Form On Creation:
Form On Resize:
Can be achieved with 'no code -'for the images above I just added labels to display panel widths on form resize. Hope this helps Paul
这篇关于Firemonkey / Delphi中的流体/动态布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!