훌이
후리스콜링개발
훌이

블로그 메뉴

  • 왈 (iOS APP)
  • Github
전체 방문자
오늘
어제
  • 전체 (171)
    • ⭐️ 개발 (140)
      • JAVA (4)
      • Web (5)
      • iOS & Swift (94)
      • iOS Concurrency (4)
      • Rx (18)
      • Git (6)
      • WWDC (1)
      • Code Refactor (3)
      • Server (1)
    • ⭐️ Computer Science (22)
      • 운영체제 (10)
      • 네트워크 (5)
      • PS (7)
    • 경제시사상식 (8)
    • 기타 등등 (0)

인기 글

최근 글

05-25 00:07

티스토리

hELLO · Designed By 정상우.
훌이

후리스콜링개발

[iOS] iOS15 tableview section header 간격 문제 해결
⭐️ 개발/iOS & Swift

[iOS] iOS15 tableview section header 간격 문제 해결

2021. 9. 28. 22:01
728x90
반응형

iOS15 tableview section header 간격 문제 해결 

iOS15 tableview section header gap 

https://developer.apple.com/documentation/uikit/uitableview/3750914-sectionheadertoppadding?language=objc

 

Apple Developer Documentation

 

developer.apple.com

 

 

 

iOS15로 업데이트 후 tableView가 이상하게 변했다.

cell이 없을 경우 section header height 값을 0으로 return 했는데도 

옆에 사진처럼 section header 간격이 잡혀버리는 것;;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

구글링 해보니 iOS15부터 새로 적용되는 기능...

sectionHeaderTopPadding 를 설정해주면 된다.

 

0으로 주면 cell 사이 선이 사라져서 안 보임

if #available(iOS 15, *) {
    tableView.sectionHeaderTopPadding = 0
}

 

 

 

1로 주면 cell 사이 선이 보임

if #available(iOS 15, *) {
    tableView.sectionHeaderTopPadding = 1
}

 

 

 

 

 


댕스투,, 볼씨. 댕수투.. 뽈씨... 문어씨...타코걸.. 댕큐댕큐..

https://stackoverflow.com/questions/68251666/ios-15-gap-between-navigation-bar-and-table-view

 

iOS 15 Gap between navigation bar and table view

With iOS 15 beta and Xcode 13 beta 2 some custom UITableViewControllers has decided to add padding between the navigation bar and the table view. Steps to reproduce: Add two UITableViewControllers ...

stackoverflow.com

 

728x90
반응형
저작자표시 비영리 변경금지 (새창열림)

'⭐️ 개발 > iOS & Swift' 카테고리의 다른 글

[Swift] ARC 공부하기  (0) 2021.10.16
[iOS] Firebase로 이메일 로그인, 애플로그인 구현하는 방법  (2) 2021.10.07
[iOS] Storyboard 없이 Navigation Controller로 시작하기  (2) 2021.09.12
[iOS] URLSession 사용해서 서버 통신해보기 (feat. 네이버 Movie API)  (2) 2021.08.29
[iOS] MVVM 패턴 가볍게 톺아보기  (1) 2021.08.26
    '⭐️ 개발/iOS & Swift' 카테고리의 다른 글
    • [Swift] ARC 공부하기
    • [iOS] Firebase로 이메일 로그인, 애플로그인 구현하는 방법
    • [iOS] Storyboard 없이 Navigation Controller로 시작하기
    • [iOS] URLSession 사용해서 서버 통신해보기 (feat. 네이버 Movie API)
    훌이
    훌이

    티스토리툴바