2013-10-27 2 views
2

현재이 문제에 직면하고 있습니다. 동적 높이 UITableViewCell을 정의해야합니다.UITableViewCell 크기 조정에 대한 제약 조건을 올바르게 정의하십시오.

적색 라인 (수직으로 성장할)보기 크기 조정에 대응

enter image description here

청색 라벨 (3 개)의 제약을 가지고 상기 각 즉시 적색 뷰 두 (> = 8), 170 번 더 낮은 우선 순위 슈퍼 뷰. 질문은, 그래서

Unable to simultaneously satisfy constraints. 
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
"<NSLayoutConstraint:0x19d65bb0 V:[UIView:0x19d9a9a0(5)]>", 
"<NSLayoutConstraint:0x19d667d0 V:[UILabel:0x19de4180(19)]>", 
"<NSLayoutConstraint:0x19d5ba70 V:[UILabel:0x19d61870(19)]>", 
"<NSLayoutConstraint:0x19d36df0 V:[UILabel:0x19d36e80(19)]>", 
"<NSLayoutConstraint:0x19d35d30 V:[UIView:0x19d36130(0)]>", 
"<NSLayoutConstraint:0x19e7b310 V:|-(5)-[UILabel:0x19d6b520] (Names: '|':UITableViewCellContentView:0x19d97580)>", 
"<NSLayoutConstraint:0x17d0b060 V:[UILabel:0x19d6b520]-(5)-[UIView:0x19d9a9a0]>", 
"<NSLayoutConstraint:0x17d0a480 V:[UIView:0x19d9a9a0]-(8)-[UILabel:0x19de4180]>", 
"<NSLayoutConstraint:0x17d0c920 V:[UILabel:0x19de4180]-(8)-[UILabel:0x19d61870]>", 
"<NSLayoutConstraint:0x17d0a100 V:[UILabel:0x19d61870]-(8)-[UIView:0x19d839e0]>", 
"<NSLayoutConstraint:0x17d11ad0 V:[UIView:0x19d839e0]-(8)-[UILabel:0x19d36e80]>", 
"<NSLayoutConstraint:0x19e742a0 V:[UILabel:0x19d36e80]-(8)-[UILabel:0x19d36770]>", 
"<NSLayoutConstraint:0x19ed84a0 V:[UILabel:0x19d36770]-(8)-[UIView:0x19d36130]>", 
"<NSLayoutConstraint:0x19e76410 V:[UIView:0x19d36130]-(>=8)-[UILabel:0x19d35560]>", 
"<NSLayoutConstraint:0x19ed8af0 V:[UILabel:0x19d35560]-(8)-[UITextView:0x1832ba00]>", 
"<NSLayoutConstraint:0x19e7abf0 V:[UITextView:0x1832ba00]-(8)-[UILabel:0x19e7d890]>", 
"<NSLayoutConstraint:0x19e83d90 V:[UILabel:0x19e7d890]-(8)-[UITextView:0x18a95e00]>", 
"<NSLayoutConstraint:0x19e7b520 V:[UITextView:0x18a95e00]-(5)-| (Names: '|':UITableViewCellContentView:0x19d97580)>", 
"<NSAutoresizingMaskLayoutConstraint:0x19d46fc0 h=--& v=--& V:[UITableViewCellContentView:0x19d97580(0)]>" 
) 

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x19d36df0 V:[UILabel:0x19d36e80(19)]> 

Break on objc_exception_throw to catch this in the debugger. 
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful. 

: 는 무엇인가

는 녹색 하나가 수퍼에 바닥 제약 조건이 (5)

난 내 코드를 실행하려고, 그것은 나에게이 있습니다 이것을 성취하는 올바른 방법 ??? 예 경우

답변

1

유는 Editor->Resolve Auto Layout Issues->Clear All Constraints In ........ Controller에, 간단한 이동을 storyboard를 사용하고, 다음 Add Missing Constraints In ...... Controller

그것은 당신이보기

+0

Thsnks 사이 contrainsts을 깨는의 문제를 해결하는 데 도움이되지만, 문제는 [얻는 방법에 UIView입니다 view에 확장 된 뷰가 포함되어야하는 최소 크기를 반영하려면 [sizeToFit] 또는 [UIView.frame] –

관련 문제