gpt4 book ai didi

ios - LMColumnView 和 LMRowView 始终保持左右间距

转载 作者:行者123 更新时间:2023-11-30 12:52:38 25 4
gpt4 key购买 nike

我正在尝试使用 MarkupKit 实现简单的布局但我总是在左边和右边留出一点空间。有办法避免这种情况吗?

<LMColumnView backgroundColor="#ffffff">
<LMSpacer weight="1"/>
<LMRowView layoutMargins="0" spacing="0" alignToBaseline="true">
<UIButton weight="1" style="systemButton" title="1" backgroundColor="left_btn_bg.png"/>
<UIButton weight="1" style="systemButton" title="2" backgroundColor="mid_btn_bg.png"/>
<UIButton weight="1" style="systemButton" title="3" backgroundColor="right_btn_bg.png"/>
</LMRowView>
</LMColumnView>

最佳答案

左右的间隙是由 UIKit 自动应用的不可变边距。将 layoutMargins="0" 添加到根 LMColumnView 应该可以工作,但事实并非如此。我不久前向 Apple 提交了有关此问题的错误报告,但从未得到回复。

最简单的解决方法是将 layoutMarginsRelativeArrangement="false" 添加到 Root View :

<LMColumnView layoutMarginsRelativeArrangement="false" backgroundColor="#ffffff">
...
</LMColumnView>

这告诉 UIKit 忽略默认边距,因此内容将与列 View 的边缘齐平。

关于ios - LMColumnView 和 LMRowView 始终保持左右间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40770430/

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