자동 레이아웃이 높이를 관리하도록하는 사용자 지정 tableview 셀이 있습니다.
tableView.estimatedRowHeight = 44
tableView.rowHeight = UITableViewAutomaticDimension
tableview 셀 안에 컨테이너 하위 뷰가 있습니다.
contentView.addSubview(calendarEventContainerView)
내가 추가하는 모든 콘텐츠가 들어가고 calendarEventContainerView
하위보기가 최소 120pts가되기를 원하지만 동시에 contentView에 고정되기를 원합니다 (contentView가 확장되도록). 제대로 표시되도록 할 수있는 유일한 경우는 내 코드가 제약 조건을 시뮬레이션 적으로 충족 할 수 없다는 오류가 표시되는 경우입니다. 내 제약 코드는 다음과 같습니다.
calendarEventContainerView.autoPinEdgeToSuperviewEdge(.Top, withInset: CalendarEventLayout.verticalInset)
calendarEventContainerView.autoPinEdgeToSuperviewEdge(.Leading, withInset: CalendarEventLayout.horizontalInset)
calendarEventContainerView.autoPinEdgeToSuperviewEdge(.Trailing, withInset: CalendarEventLayout.horizontalInset)
calendarEventContainerView.autoPinEdgeToSuperviewEdge(.Bottom)
calendarEventContainerView.autoSetDimension(.Height, toSize: 120, relation: NSLayoutRelation.Equal)
내가 뭘 잘못하고 있는지 아이디어가 있습니까?
알려지지 않은 이유로 제약 조건의 우선 순위를 999로 낮추면 크기 자동 조정에 대한이 문제가 해결되는 것 같습니다 UITableViewCell
.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다