简体   繁体   中英

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

How can I achieve the equivalent of this in storyboard?

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

Very easily, in storyboard, control click on view and drag to the other view. Then click settings of the constraints on the right:

在此处输入图片说明

and click on Select and edit which will take you to constraints settings:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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