Last active
August 9, 2018 07:36
-
-
Save cozzin/fea82d3574809a87f1f949c17f7fd543 to your computer and use it in GitHub Desktop.
여러 UI 컴포넌트들이 있는 HeaderView의 높이 계산해주기
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
UILabel 하나만 HeaderFooterView의 subview로 추가된다면 상관없지만
여러개의 UILabel 을 HeaderFooterView로 사용하는 경우 문제가 발생 했었다.
systemLayoutSizeFitting 만 쓰게되면 높이를 계산할 때 priority를 제대로 결정하지 못하는 이슈가 발생한다.
그래서 헤더에 여러 UI 요소들이 있을 때는 priority를 설정해 줄 수 있는 아래와 같은 함수를 사용하도록 하자.