<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">gravity : 모든 View 들의 공통된 속성
layout_gravity : 모든 layout 들의 공통된 속성
부모뷰의 속성
자식컴포넌트에 따로 부여할 속성은 없다
<LinearLayout
android:layout_width="413dp"
android:layout_height="118dp"
android:background="@color/colorPrimary"
android:gravity="bottom"
android:orientation="horizontal">
</LinearLayout>
// orientation : 배치방향 결정
// gravity : 하위 뷰들에 대한 중력 방향 결정
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
</RelativeLayout>
| layout_alignParentTop | 부모의 상단에 객체를 배치 |
|---|---|
| layout_alignParentBottom | 부모의 하단에 객체를 배치 |
| layout_alignParentRight | 부모의 우측에 객체를 배치 |
| layout_alignParentLeft | 부모의 좌측에 객체를 배치 |
| layout_centerHorizontal | 부모의 가로축 중앙에 객체를 배치 |
| layout_centerVertical | 부모의 세로축 중앙에 객체를 배치 |
| layout_centerInParent | 부모의 가로, 세로 축 중앙에 객체를 배치 |
<TextView
android:layout_width="50dp"
android:layout_height="50dp"
android:text="TextView08"
android:background="#5c6bc0"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"/>
<TextView
android:layout_width="50dp"
android:layout_height="50dp"
android:text="TextView09"
android:background="#f06292"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/button31"
android:layout_width="301dp"
android:layout_height="162dp"
android:text="Button3" />
<Button
android:id="@+id/button32"
android:layout_width="147dp"
android:layout_height="90dp"
android:background="@color/colorPrimary"
android:text="Button2" />
<Button
android:id="@+id/button33"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/colorAccent"
android:text="Button1" />
</FrameLayout>
<TableLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="8dp">
<TableRow>
. . .
</TableRow>
<TableRow>
. . .
</TableRow>
</TableLayout>
부모뷰의 속성
자식뷰의 속성
<GridLayout
android:layout_width="match_parent"
android:layout_height="350dp"
android:orientation="horizontal"
android:columnCount="3">
<Button android:text="6" android:layout_width="200dp"/>
<Button android:text="7" android:layout_column="1"/>
<Button android:text="8" android:layout_column="0"/>
<Button android:text="9" android:layout_row="3" android:layout_column="2"/>
<Button android:text="10" android:layout_row="3" android:layout_column="2"/>
<Button android:text="11" android:layout_columnSpan="2" android:layout_gravity="fill_horizontal"/>
<Button android:layout_rowSpan="2" android:layout_gravity="fill_vertical"/>
</GridLayout>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
// 내용
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="카테고리"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraint( A )_to( B )Of=””
app:layout_constraintDimensionRatio



