【发布时间】:2013-07-28 14:27:31
【问题描述】:
尝试使用 TGridLayout 来保存一系列 TImage 对象,每个对象都加载了一个位图,我得到了一些结果。但是,控制之间没有余量。我已经尝试使 TImage 宽度/高度小于 TGridLayout itemheight/itemwidth,但没有运气。
示例代码:
ImageRef := TImage.Create(GridLayoutGallery);
ImageRef.Visible := False; // se true later
ImageRef.Width := GridLayoutGallery.ItemWidth - 10;
ImageRef.Height := GridLayoutGallery.ItemHeight - 10;
GridLayoutGallery.AddObject(ImageRef);
【问题讨论】:
-
您是否尝试将
YourImage.AlignWithMargins设置为True,然后调整YourImage.Margins属性? -
@LightBulb,通过为每个单独的图像设置边距会导致图像缩小并且质量会受到影响。最终布局中每个对象的大小由 GridLayout 组件本身决定。
-
@LightBulb 谢谢。这个建议确实有效,我将暂时使用,直到我有更多时间尝试其他建议的解决方案。 (我的日程安排很紧)
标签: ios delphi firemonkey