아이폰 개발
Swift TableView 가변 높이 처리
나숑
2021. 5. 19. 20:10
앱 개발을 하다보면 가변하는 컨텐츠 크기에 맞춰서 TableView의 Cell 높이를 동적으로 처리해야하는 경우가 있다
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
How to make UITableViewCells auto resize to their content - free Swift 5.1 example code and tips
Was this page useful? Let us know! 1 2 3 4 5
www.hackingwithswift.com
https://gigas-blog.tistory.com/2
Swift 4 TableView 동적 높이 설정
테이블 뷰를 사용할때 고정된 정적 높이가 아닌 동적 높이로 구현하고 싶을때가 있습니다. 카카오톡의 장문 내용처럼 개행을 했을때 일정하게 늘어나야 하지만 조금씩 뒤틀립니다. 기존에는 아
gigas-blog.tistory.com
테스트를 위해서 임의의 텍스트를 자동 생성하는 라이브러리는 이것을 이용하였다
https://cocoapods.org/pods/LoremIpsum
LoremIpsum
A lightweight lorem ipsum and image placeholders generator for Objective-C.
cocoapods.org