繁体   English   中英

如何在情节提要中向 UILabel 的右边缘添加前导约束?

[英]How to add leading constraint to the right edge of the UILabel in storyboard?

我怎样才能在故事板中达到这个效果?

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

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

在此处输入图片说明

并单击“选择和编辑” ,这将带您进入约束设置:

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM