UITableView separator 구분선 정렬

이지수·2023년 8월 25일
0

Swift학습

목록 보기
13/14

문제

  • Seperator(구분선)이 위 화면처럼 오른쪽으로 치우쳐져 있다.
  • 기본적으로 이런데 왜 그런지 궁금..

해결방법

  • seperator의 edge inset을 조정한다.
cell.separatorInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
  • 위 코드를 tableView(:cellForRowAt:)에 추가

참고

https://www.mysamplecode.com/2019/04/ios-swift-customize-uitableview-separator.html

profile
iOS 개발자 꿈나무

0개의 댓글