[英]Place label on top of each other next to an image
In this case, I might be tempted to just use a UIStackView
- it might be a little overkill, but one of the benefits is if you hide one of the labels (because it's text is nil) it will reduce the size of the StackView
, which, personally, makes the layout look nicer, but that's me 在这种情况下,我可能会想只使用
UIStackView
可能有点过大,但是好处之一是,如果隐藏其中一个标签(因为它的文本为nil),它将减小StackView
的大小,就个人而言,这使布局看起来更好,但这就是我
UIImageView
constraints UIImageView
约束 UIStackView
constraints UIStackView
约束 UIStackView
properties UIStackView
属性 *nb: This still assumes that the overall height of the text won't exceed the height of the UIImageView
* nb:这仍然假设文本的整体高度不会超过
UIImageView
的高度
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.