cozzin
코찐 기술 블로그
cozzin
전체 방문자
오늘
어제
  • 분류 전체보기
    • Kotlin
    • 백엔드
    • iOS
      • Swift
      • SwiftUI
      • Combine
      • Architecture
    • 개발환경
    • 세미나
    • 생각정리
    • 스터디
    • CS
      • Refactoring
      • OS

블로그 메뉴

  • 홈
  • 태그
  • 방명록
  • LinkedIn
  • 강의

공지사항

인기 글

태그

  • ios
  • Warning
  • 리팩토링
  • 운영체제
  • SwiftUI
  • Ribs
  • multicast
  • WWDC
  • 테스트
  • 디자인패턴
  • 컴퓨터공학
  • slide-over
  • Swift
  • WWDC21
  • os
  • 워닝제거
  • darkmode
  • XCode
  • Combine
  • CS

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
cozzin

코찐 기술 블로그

iOS

[iOS] grouped style tableView에서 위아래 여백 제거하기

2021. 1. 28. 11:26
반응형

UITableView(frame: .zero, style: .grouped)로 사용하는데 상하단의 여백을 없애고 싶을 때가 있습니다.

이 글에서는 하단의 여백을 없애는 것으로 예를 들어보겠습니다.

두가지를 지정해주면 됩니다.

 

1. header or footer height를 최소로 지정

func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
    UIView()
}

func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
    .leastNormalMagnitude
}

2. content inset 없애기

tableView.contentInset = .zero
tableView.contentInsetAdjustmentBehavior = .never

 

반응형
저작자표시 (새창열림)

'iOS' 카테고리의 다른 글

워닝 제거하기: Skipping duplicate build file in Compile Sources build phase  (0) 2021.01.29
워닝 제거하기: Implicit import of bridging header '{YourApp}-Bridging-Header.h' via module '{YourApp}' is deprecated and will be removed in a later version of Swift  (0) 2021.01.29
[iOS] 이슈 해결: CloudKit integration does not support unique constraints  (0) 2021.01.23
[iOS] UITextField placeholder color 변경하기  (0) 2021.01.20
[iOS] overrideUserInterfaceStyle 부분 적용하기  (0) 2021.01.20
    'iOS' 카테고리의 다른 글
    • 워닝 제거하기: Skipping duplicate build file in Compile Sources build phase
    • 워닝 제거하기: Implicit import of bridging header '{YourApp}-Bridging-Header.h' via module '{YourApp}' is deprecated and will be removed in a later version of Swift
    • [iOS] 이슈 해결: CloudKit integration does not support unique constraints
    • [iOS] UITextField placeholder color 변경하기
    cozzin
    cozzin
    Software Engineer

    티스토리툴바