加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

修复 XE8 FMX TGridLayout 容器自动计算宽度及高度的问题

发布时间:2020-12-15 04:36:56 所属栏目:大数据 来源:网络整理
导读:说明:TGridLayout 提供计算容器内控件等分的功能: 横式(Orientation=Horizontal)可将 ItemWidth = -1 直式(Orientation=Vertical)可将 ItemHeight = -1 当 TGridLayout 设定 Padding 边界时,会造成等分计算错误。 适用:XE8 Firemonkey 修复方法: 请

说明:TGridLayout 提供计算容器内控件等分的功能:

  • 横式(Orientation=Horizontal)可将 ItemWidth = -1
  • 直式(Orientation=Vertical)可将 ItemHeight = -1

当 TGridLayout 设定 Padding 边界时,会造成等分计算错误。

适用:XE8 Firemonkey

修复方法:

请将源码 FMX.Layouts.pas复制到自己的工程目录里,再进行修改。

CurPos.X + LItemWidth > Self.Width - Self.Padding.Left - CurPos.X + LItemWidth - Self.Padding.Left - > Self.Width - Self.Padding.Left -找到:
<span style="color: #0000ff;">if
CurPos.Y + LItemHeight > Self.Height - Self.Padding.Top -<span style="color: #000000;">
改成:
<span style="color: #0000ff;">if
CurPos.Y + LItemHeight - Self.Padding.Top - <span style="color: #800080;">0.1
> Self.Height - Self.Padding.Top -

效果:

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读