Grouped UItableView 영역 머리글 및 바닥글 여백을 제거하는 방법
2038 단어 iOS
필요조건
UItableView를 Grouped Style로 설정하면 머리글 및 바닥글 영역에 이러한 여백이 나타납니다.이거 잃어버리고 싶어요.
이미지
대응
UItable ViewDelegate에서 영역 제목과 바닥글의 높이 값을 반환하고 여기CGFloat.leastNormalMagnitude
에서 높이 값을 지정하면 예제의 공백을 없앨 수 있습니다.
그나저나 return 0.0
과tableView.sectionFooterHeight = CGFloat.leastNormalMagnitude
는 효과가 없다.
UITableViewDelegatefunc tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return CGFloat.leastNormalMagnitude
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return CGFloat.leastNormalMagnitude
}
결실
Reference
이 문제에 관하여(Grouped UItableView 영역 머리글 및 바닥글 여백을 제거하는 방법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/usagimaru/items/9e821ec0c3d9028f8527
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
UItable ViewDelegate에서 영역 제목과 바닥글의 높이 값을 반환하고 여기
CGFloat.leastNormalMagnitude
에서 높이 값을 지정하면 예제의 공백을 없앨 수 있습니다.그나저나
return 0.0
과tableView.sectionFooterHeight = CGFloat.leastNormalMagnitude
는 효과가 없다.UITableViewDelegate
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return CGFloat.leastNormalMagnitude
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return CGFloat.leastNormalMagnitude
}
결실Reference
이 문제에 관하여(Grouped UItableView 영역 머리글 및 바닥글 여백을 제거하는 방법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/usagimaru/items/9e821ec0c3d9028f8527텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)