UIKIT/UITableView (3) 썸네일형 리스트형 ❓backgroundColor와 contentView.backgroundColor의 차이 1. backgroundColorUITableViewCell 자체의 배경색을 설정.셀의 바깥쪽 전체 배경색을 담당.contentView가 차지하지 않는 영역(즉, 셀과 셀 사이의 간격이나 inset으로 인해 생긴 공간)에 영향을 줌. 2. contentView.backgroundColor셀의 **내용이 들어가는 부분(contentView)**의 배경색을 설정.UITableViewCell은 contentView라는 서브뷰를 기본적으로 가지고 있으며, 모든 UI 요소는 여기에 추가되는 게 일반적.contentView.layer.cornerRadius = 10 같은 설정이 이 영역에만 적용됨.override init(style: UITableViewCell.CellStyle, reuseIdentifier: S.. 🤔 테이블 셀에 별도의 UITableViewCell을 만들지 않는다면? // ✅ 기본 UITableViewCell 등록 addItemTableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell")// MARK: - Extension: 테이블 델리게이트 설정extension AddPlanViewController: UITableViewDelegate, UITableViewDataSource { ... // ✅ 각 셀을 별도로 만들지 않음 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { switch AddItemTableSectio.. 🤔 UITableView의 grouped 스타일에서 섹션 간 간격을 늘리는 방법 ❌ 현재 섹션간의 간격을 늘리고자 아래와 같이 했으나.. 적용안됨 일정표 섹션과 진행 중인 계획 섹션 간의 간격이 늘어나지 않음..extension HomeViewController: UITableViewDelegate, UITableViewDataSource { ... // ✅ 섹션 높이 설정 func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { return 30 // 섹션 간 간격 }} 🔨 해결 방법heightForFooterInSection을 사용해서 섹션 간 간격을 늘리는 건 일반적으로 맞는 방법하지만 UITableView의 grouped 스.. 이전 1 다음