์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- ๋ฐฑ์ค
- Kuring
- raywenderlich
- CollectionView
- Lv2
- realm
- Xcode
- ios
- arkit
- Flutter
- reactorkit
- Swfit
- RxSwift
- SnapKit
- rxcocoa
- BOJ
- MVVM
- node.js
- visionOS
- tableView
- ํ๋ก๊ทธ๋๋จธ์ค
- combine
- swift
- XCTest
- ํจ์คํธ์บ ํผ์ค
- BFS
- designpattern
- TCA
- SwiftUI
- UIKit
Archives
- Today
- Total
lgvv98
iOSInterviewquestions - Autolayout ๋ณธ๋ฌธ
โ ๏ธ deprecated โ ๏ธ/๐ง๐ป๐ป iOSInterviewquestions
iOSInterviewquestions - Autolayout
๐ฅ ์บ๋ฟ๋งจ 2022. 4. 2. 03:01iOSInterviewquestions - Autolayout
๋ชฉ์ : ๋ฐฐ์ธ๋๋ ์ํ๋๋ฐ, ๋์ด๊ฐ ๋จน์ผ๋๊น ์๊พธ ๊น๋จน์ด์ ์๋ ๊นํ๋ธ ๊ธ์ ๋ฐํ์ผ๋ก ๊พธ์คํ ์ด๋ก ๊ณต๋ถ๋ฅผ ํ๊ณ ์ ํจ. ๋ฌผ๋ก ์ค๋ช ์ ๋ด๊ฐ ์ ์๋๊ฒ ๋ชฉ์ ์ด๋ผ ์ฒ ์ ํ ๋๋ฅผ ์ดํด์ํฌ ์ ์๋ ๋์ ์ธ์ด๋ก ์์ฑ.
์์ฑ์ผ : 2022๋ 4์ 2์ผ
- README: ์ถํ์ ์์ ์ด ์์ ๊ฒฝ์ฐ ์๋์ ๋ ์ง์ ์๊ฐ์ ์์ฑํ๊ณ , ์์ ๋ด์ฉ์ ๊ฐ๋ตํ ์ ๋ฆฌํด์ฃผ์ธ์.
์์)
(์์ ) oooo๋ oo์ oo์ผ oo์ oo๋ถ
- ๋ณ๊ฒฝ๋ด์ฉ : xxx์ ๋ํ ์๋ฃ๋ฅผ ๋ณด๊ฐ
โ ๊ณต๋ถ์ ๊ธฐ์ค์ด ๋๋ ๊นํ๋ธ ๊ธ
https://github.com/JeaSungLEE/iOSInterviewquestions
โ Autolayout
- ์คํ ๋ ์ด์์์ ์ฝ๋๋ก ์์ฑํ๋ ๋ฐฉ๋ฒ์ ๋ฌด์์ธ๊ฐ? (3๊ฐ์ง)
- Layout Anchor๋ฅผ ์ฌ์ฉ(์ ์ผ ์ต์ํ ๋ฐฉ๋ฒ์ด์, SnapKit์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ๊ณผ ๋์ผ)
- NSLayoutConstraint๋ฅผ ์ฌ์ฉํ๋ ๋ฐฉ์
- visual foromat language๋ฅผ ์ฌ์ฉ(์๊ฐ์ ์ผ๋ก ์ ์ํ๋ ํน์ดํ ๋ฐฉ์)
- (์ฐธ๊ณ ) https://sueaty.tistory.com/174
- hugging, resistance์ ๋ํด์ ์ค๋ช
ํ์์ค.
- hugging์ ๋จ์ด ๋ป ๊ทธ๋๋ก ๋๊ตฐ๊ฐ๋ฅผ ์์์ผํ๋ค๊ณ ์๊ฐํ์. ๋ฐ๋ผ์ ๋๊ตฐ๊ฐ๊ฐ ์ปค์ ธ์ผ ํ๋ ๊ฒฝ์ฐ hugging priority๊ฐ ๋์ ๊ฒ์ด ์์๊ฒ์ ๋์ด ์๋๋ค. ์ฆ, ์ฐ์ ์์๊ฐ ๋์ ๊ฒ์ด ์๊ธฐ ํฌ๊ธฐ๋ฅผ ์ ์งํ๊ณ , ์์ ๊ฒ์ ๋์ด ๋น๊ธด๋ค.
- resistance์ ๋จ์ด ๋ป ๊ทธ๋๋ก ์์ถ์ ์ ํญํ์๊ณ ์๊ฐํ์. ๋ฐ๋ผ์ ๋๊ตฐ๊ฐ๊ฐ ์์์ ธ์ผ ํ๋ ๊ฒฝ์ฐ resistance priority๊ฐ ๋์ ๊ฒ์ด ์์ถ์ ๋ํ ์ ํญ ๊ฐ๋๊ฐ ๋ ์์ ์์ ์ ์์น๋ฅผ ์ ์งํ๋ค.
- Intrinsic Size์ ๋ํด์ ์ค๋ช
ํ์์ค.
- ์ปจํ ์ธ ์ ๋ณธ์ง์ ์ ํฌ๊ธฐ๋ก UI ์์๋ค ์ค ์ผ๋ถ๋ ๊ธฐ๋ณธ์ ์ผ๋ก Intrinsic Content Size๋ฅผ ๊ฐ๊ณ ์๋ค. UILabel์ ๊ฒฝ์ฐ์๋ Intrinsic Content Size๋ฅผ ๊ฐ๊ณ ์์ด์ ๋ฐํ์์์ UI๊ฐ ๋ณ๊ฒฝ๋์ด์ ๊ทธ์ ๋ง์ถ์ด์ ๊ธธ์ด๊ฐ ๊ฐ๋ณ์ ์ผ๋ก ์๋์ผ๋ก ๋ฐ๋๋๊ฒ ์ ์ฉ๋๋ค. ๋ํ width ๋ฐ height๋ฅผ ๊ฐ์ง์ง ์์๋ ๋ ์ด์์ ์๋ฌ(๊ฒฝ๊ณ ์ ๋ค๋ฆ)๊ฐ ๋์ง ์์.
- (์ฐธ๊ณ ) https://babbab2.tistory.com/135
- ์คํ ๋ฆฌ๋ณด๋๋ฅผ ์ด์ฉํ์๋์ ์ฅ๋จ์ ์ ์ค๋ช
ํ์์ค.
- ์ง๊ทนํ ๋ด ๊ธฐ์ค์ผ๋ก ์์ฑํจ.
- (์ฅ์ ) UI ํ๋์ ๋ณผ ์ ์์ผ๋ฉฐ, ์ธ๊ทธ ์ฐ๊ฒฐ ๋ฐ ๊ฐ๊ฐ์ ์์๋ค์ ์์ฑ์ ์ฝ๊ฒ ์ค์ ํ ์ ์๋ค.
- (๋จ์ ) Xcode๊ฐ ๋ฌด๊ฑฐ์์ง๋ฉฐ, ํ์ ์์ ์ถฉ๋๋ก ์ธํ ๋ฌธ์ ๋ฅผ ๊ฒช์ ์ ์์.
- Safearea์ ๋ํด์ ์ค๋ช
ํ์์ค.
- ๋ ธ์น๊ฐ ์๋ ๊ธฐ๊ธฐ๊ฐ ์ถ์๋๋ฉด์, UI๊ฐ ๋ ธ์น์ ์ํด์ ๊ฐ๋ ค์ง๋ ๋ฌธ์ ๊ฐ ๋ฐ์ํ ์ ์๊ฒ ๋์์. SafeArea๋ ์ด ์์ญ์ ์ ์ธํ๊ณ UI๊ฐ ์จ์ ํ๊ฒ ๋ณด์ผ ์ ์๋ ํ๋ฉด์ ๋ถ๋ถ์.
- Left Constraint ์ Leading Constraint ์ ์ฐจ์ด์ ์ ์ค๋ช
ํ์์ค.
- ์ ํ์ ๊ณต์์ ์ผ๋ก left/right๋ณด๋ค leading/trailing์ ๊ถ์ฅํ๊ณ ์์. reading direction์ ์ํฅ์ ๋ฐ๋๋ฐ ์ฐ๋ฆฌ๋๋ผ๋ (์ผ->์ค)์ด์ง๋ง ์ด๋ค ๋๋ผ๋ (์ค->์ผ) ์ผ์๋ ์์ left ๋ reading direction์ ๊ด๊ณ์์ด ๊ณ ์ ์ด๊ณ , leading์ ์ด ๋ฐฉํฅ์ ๋ง์ถฐ์ง ์ฐ๋ฆฌ๋๋ผ ๊ธฐ์ค์ผ๋ก leading์ ์ผ์ชฝ
'โ ๏ธ deprecated โ ๏ธ > ๐ง๐ปโ๐ป iOSInterviewquestions' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
iOSInterviewquestions - iOS (0) | 2022.04.06 |
---|---|
iOSInterviewquestions - ARC (0) | 2022.04.02 |
iOSInterviewquestions - Rx (0) | 2022.04.02 |
iOSInterviewquestions - Swift (0) | 2022.04.02 |
Comments