티스토리 뷰



ConstraintLayout ?


안드로이드가 2016년 Google I/O 에서 발표한 Layout

기본 속성은 Relative Layout 과 비슷하지만, 좀 더 많은 속성값을 가지고 있어서 유연한 배치가 가능한 Layout




왜 써야 하는가


왜 이걸 써야하는가? 그 이유를 나는 1년정도는 깨닫지 못했고..

여전히 LinearLayout.. RelativeLayout 을 이용하고 있었다. (아직도 Linear가 편하긴하다....)

왜 써야하는지 알아야 쓸것이기 때문에.. 왜 이걸 써야하는지 찾아보았고, 

아래의 이유들을 찾았다.


1. Relative 보다 더 유연한 위치속성

- RelativeLayout 뷰 위치 속성

layout_toRightOf

layout_toLeftOf

layout_toTopOf

layout_toBottomOf

- ConstraintLayout 뷰 위치 속성

layout_constraintTop_toTopOf

layout_constraintTop_toBottomOf

layout_constraintBottom_toTopOf

layout_constraintBottom_toBottomOf

layout_constraintLeft_toTopOf

layout_constraintLeft_toBottomOf

layout_constraintLeft_toLeftOf

layout_constraintLeft_toRightOf

layout_constraintRight_toTopOf

layout_constraintRight_toBottomOf

layout_constraintRight_toLeftOf 

layout_constraintRight_toRightOf 

left, right 정렬에 대해 start, end속성 지원



2. 성능 문제

Layout별 성능 비교[Measure 호출횟수 비교] (LinearLayout vs RelativeLayout vs ConstraintLayout)






공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
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
글 보관함