【问题标题】:How to add leading constraint to the right edge of the UILabel in storyboard?如何在情节提要中的 UILabel 的右边缘添加前导约束?
【发布时间】:2014-04-15 11:17:31
【问题描述】:

我怎样才能在情节提要中实现这一点?

[cell addConstraint:[NSLayoutConstraint constraintWithItem:nameLabel
                                                 attribute:NSLayoutAttributeRight
                                                 relatedBy:NSLayoutRelationEqual
                                                    toItem:cell.contentView
                                                 attribute:NSLayoutAttributeLeft
                                                multiplier:1.0
                                                  constant:200.0]];

【问题讨论】:

    标签: ios objective-c uilabel autolayout


    【解决方案1】:

    很容易,在情节提要中,控制单击视图并拖动到另一个视图。然后点击右侧约束的设置:

    然后点击选择和编辑,这将带您进入约束设置:

    【讨论】:

    • 太好了,所以我将检查器中标签上的约束从前导更改为尾随,它可以工作。谢谢!
    • 没有问题,很高兴我能帮上忙。
    猜你喜欢
    • 1970-01-01
    • 2018-02-02
    • 2016-11-16
    • 1970-01-01
    • 2020-09-07
    • 1970-01-01
    • 2015-02-27
    • 2017-03-27
    • 2015-04-20
    相关资源
    最近更新 更多