设置堆栈视图中的一个成员的对齐方式

huangapple go评论57阅读模式
英文:

Set alignment for one member in the stackView

问题

我有一个包含三个项目的堆栈视图,其中有2个标签(一个位于左侧,另一个位于右侧),以及一个视图作为中间的分隔符。
堆栈视图的配置应该是这样的,使分隔符具有左对齐。
我的意思是,分隔符应该离左侧项目更近,而不是右侧项目。

感谢您的帮助。

英文:

I have a stack view that contains three item, 2 labels (one of them in the left side and another one in the right side), and one view as a separator in the middle.
How the configuration of the stackView should look like that the separator has a left alignment.
I mean the separator should stay closer to the left item than the right one.

your help will be appreciated.

答案1

得分: -3

给分隔符一个固定宽度,并在分隔符后面的堆栈中添加另一个空的 UIView(),该视图将覆盖剩余的空间。这样,您的右侧标签将保持在右侧,而左侧标签与分隔符对齐在左侧。干杯

英文:

Give separator a fix width and add another empty UIView() in the stack after separator which will cover the remaining space. This way your right label stay on right and left label with separator aligns left Cheers

huangapple
  • 本文由 发表于 2020年1月3日 17:27:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/59575999.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定