[英]How to resolve auto layout constraints for my view
以下是我的組件層次結構:
查看 Controller
看法
- 看法
--表格視圖
---表格單元格
1. 標題 Label
2. 編輯按鈕
3.刪除按鈕
我提供了如下約束:
標題 label:
Leading space to superview
trailing space to Edit button
bottom space to superview
top space to superview
編輯按鈕
trailing space to remove button
leading space to title label
bottom space to superview
top space to superview
刪除按鈕
Trailing space to superview
width = 40
leading space to edit button
align center Y
height = 40
我收到標題 label、編輯和刪除按鈕的警告“需要 X 和寬度”。
有什么幫助嗎?
將Edit button
的寬度約束設置為 40 與刪除按鈕寬度相同。
編輯按鈕
trailing space to remove button
leading space to title label
width = 40
bottom space to superview
top space to superview
如果按鈕寬度不固定,那么您需要更新內容擁抱優先Horizontal
值。
Select 編輯按鈕並將Content Hugging Priority
Horizontal
ntal 值從 250 更改為 251
或者
Select Title Label 並將Content Hugging Priority
Horizontal
ntal 值從 250 更改為 249
希望這會有所幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.