当标签内部有更多文本时,展开Uiview宽度
我有2个带有标签的Uiviews。 Uiview应根据标签中的内容扩展。以下是布局:
以上两个视图可以根据标签中的内容扩展。我试图用AutoLayout设置布局,但宽度始终是固定的。以下是我对第二视图的限制:
I have 2 UIViews with labels inside. The UIView should expand depending on the content in the label. Following is the layout:
Both of the above views can expand depending on the content in the label. I have tried to set layout with autolayout but the width is always fixed. Following are my constraints for second view:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来您的第一个视图缺少对内部标签的领先约束。
It looks like your first view is missing a leading constraint to the label inside.