【问题标题】:Xcode 9 - Labels overlapping on iPhone SE Screen sizeXcode 9 - 标签在 iPhone SE 屏幕尺寸上重叠
【发布时间】:2018-05-07 10:47:00
【问题描述】:

我不知道需要添加什么约束来防止标签在较小的屏幕尺寸上重叠。我尝试在两个标签之间放置一个水平约束,但是在较大的屏幕尺寸上,符号标签不会停留在视图的末尾。

这些是我为这两个标签设置的约束。
https://i.imgur.com/cicPYBR.png - 约束 1
https://i.imgur.com/cicPYBR.png - 约束 2

这就是它在 iPhone SE 上的样子。
https://i.imgur.com/yxE9ce7.png

【问题讨论】:

    标签: xcode nslayoutconstraint


    【解决方案1】:

    简单的方法

       Use Stackview and add both of your view 
    

    有约束

    在您的左侧标签(我可以在哪里......)添加

    Leading , Top , Bottom , Trailing (>= Relation) (with right side view which has play icon)
    

    在您的骑行侧视图(带有播放图标)中添加

    Top, Bottom, Trailing (= relation ) (with super view) , Width (Whatever your constant with >= Relation )
    

    在您的第一个标签中,您可以将第 2 行数和换行模式设置为自动换行以在小型设备中遇到 ...

    希望对你有帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-12-15
      • 1970-01-01
      • 1970-01-01
      • 2012-04-10
      • 2012-09-17
      • 2015-01-31
      • 1970-01-01
      • 2015-07-18
      相关资源
      最近更新 更多