1. ๐ AutoLayout : TableView_Text_Dynamic_Cell
1.0.1. Text Line์ ๋ฐ๋ผ Cell์ ๋์ด๋ฅผ ๋์ ์ผ๋ก ๋ณํ๊ฒ ํ๋ ๋ฐฉ๋ฒ


tableView
tableViewCell ์ค์ ํ
Label 4๊ฐ๋ฅผ ๋ชจ๋ ์ํ์ข์ฐ 20์ ์ค๋ค.
( ์ ์ผ ์ฐ์ธก ์๋จ์ bottom์ ์ ๊ฑฐ )
์ผ์ชฝ 3๊ฐ์ ๋ผ๋ฒจ Hugging Priority - Vertical์ ์กฐ์ ํ์ฌ ์ ๋ ฌํ๋ค.

Cell์ identifier ์ค์

tableView๋ฅผ VC์ dataSource, delegate ์ฐ๊ฒฐ

protocol ์ถ๊ฐ ํ ์ฝ๋ ์ ๋ ฅ

ํ์ฌ๊น์ง์ ๊ฒฐ๊ณผ

MyCell์ Class๋ฅผ ๊ฐ์ ํ์ผ์ ์์ฑํ์ฌ์ฃผ๊ณ ( ๋ค๋ฅธ ํ์ผ์ ๋ง๋ค์ด์ค๋ ๋๋ค )
Cell์์ Label์ค ์ตํ๋จ์ ๊ฒ์ IBOulet ์ค์ ํ๋ค.

talbeViewCell์ Class๋ฅผ ์กฐ๊ธ ์ ์์ฑํ๋
MyCell Class์ ์ฐ๊ฒฐ

ํ์ฌ๊น์ง ์ฝ๋


Label์ Lines ์์ฑ์ 0์ผ๋ก ๋์ด ํ ์คํธ๊ฐ ์งค๋ฆฌ๋๊ฑธ ํด๊ฒฐํ ์์ ๋ค.

์ต์ข ์ฝ๋
tableViewCell์ ๋์ด๋ฅผ ์ ๋์ ์ผ๋ก ํ๊ธฐ ์ํด์ ์ญ์๋ ๋ง์ฐฌ๊ฐ์ง๊ณ
UITableView.automaticDimension ์์ฑ์ ๊ธฐ์ตํด์ผ ํ๋ค.
ํด๋น ์์ฑ๊ณผ 'estimateHeightForRowAt'์ ์ ์ ์ฉํ์.

text์ ๊ธธ์ด์ ๋ฐ๋ผ ๋์ด๊ฐ ์กฐ์ ๋๋ ์ต์ข ํ๋ฉด ์์ฑ
'๐ iOS > UIKit' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[iOS] Cell ๊ทธ๋ฆผ์ + ๋ฅ๊ธ๊ฒ ( shadow, cornerRadius ) (0) | 2023.05.23 |
---|---|
[iOS] Delegate ํจํด์ ๋ํด์ (0) | 2023.04.05 |
[iOS] AutoLayout : TableView_Expand (0) | 2023.04.04 |
[iOS]AutoLayout : pop up _ animation (0) | 2023.04.02 |
[iOS] AutoLayout : Graph _ Animated (0) | 2023.03.31 |