当标签内部有更多文本时,展开Uiview宽度

发布于 2025-02-01 08:56:09 字数 539 浏览 3 评论 0原文

我有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:
enter image description here

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:

enter image description here

First view constraints:
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风追烟花雨 2025-02-08 08:56:09

看来您的第一个视图缺少对内部标签的领先约束。

It looks like your first view is missing a leading constraint to the label inside.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文