簡體   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