1. ๐ AutoLayout : TableView_Expand
1.0.1. ์์ ๋ก์ด ๋์ ๋์ด

Table View์ Cell ์ ํด๋ฆญํ์๋ Cell ์ ๋์ด๊ฐ ๋์ ์ผ๋ก ๋ณํ๋ ( expand ) Layout

tableView - tableViewCell - Label ๋ ์ด์์ ์ค์ ํ
MyCell ํด๋์ค๋ฅผ ์์ฑํ์ฌ label Outlet ์ค์
์ดํ tableView์ ํด๋นํ๋ ์ฝ๋๋ฅผ ๊ตฌ์ฑํด์ค๋ค.
๋ค ๋๋ค๋ฉด ์คํ ๋ฆฌ๋ณด๋์ tableView๋ฅผ ์์ VC์ dataSource, delegate๋ฅผ ์ฐ๊ฒฐํ๋ค.

( TableViewCell์ identifier = expandCell ์ค์ ํ
Class๋ฅผ ์์ฑํด์ฃผ์๋ MyCell๊ณผ ์ฐ๊ฒฐํด์ฃผ์ด์ผํ๋ค. )
( Label ์ Lines๋ 0 ์ผ๋ก ํด์ฃผ์ด์ผ ํ๋ค. )

Label์ ๋ค์ด๊ฐ ์์ Text๋ฅผ Array๋ฅผ ์ด์ฉํด ์์ฑํด์ค๋ค.


ํ ์ด๋ธ๋ทฐ์ cell์ ํด๋ฆญํ์๋ ๋์ด๊ฐ ์๋์ผ๋ก ๋ณํ๊ฒ ํ๊ธฐ ์ํด์
UITableView.automaticDimension ์ ์ธ์๋ฌ์ผํ๋ค.
'๐ iOS > UIKit' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[iOS] Delegate ํจํด์ ๋ํด์ (0) | 2023.04.05 |
---|---|
[iOS]AutoLayout : TableView_Text_Dynamic_Cell (0) | 2023.04.04 |
[iOS]AutoLayout : pop up _ animation (0) | 2023.04.02 |
[iOS] AutoLayout : Graph _ Animated (0) | 2023.03.31 |
[iOS] AutoLayout : Dynamic Text ( ๋์ ํ ์คํธ ) (0) | 2023.03.30 |