728x90
반응형
💡레이아웃
◾ LinearLayout
◾ ConstraintLayout
◾ RelativeLayout
◾ GridLayout
◾ TableLayout
◾ FrameLayout
◾ LinearLayout이 가지고 있는 weight 속성
💡리니어 레이아웃의 중첩
📃 리니어 레이아웃 중첩 응용 (1)
📝test2.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BTN 1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="BTN 2" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BTN 3" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BTN 4" />
</LinearLayout>
</LinearLayout>
📃리니어 레이아웃 중첩 응용 (2)
◾ 실행 결과
📝test3.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="4"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#1C3879"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#607EAA"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#EAE3D2"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#F9F5EB"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#1C3879"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#607EAA"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#EAE3D2"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#F9F5EB"/>
</LinearLayout>
</LinearLayout>
728x90
반응형
'App > Android Studio' 카테고리의 다른 글
Android Studio - GridLayout (0) | 2022.08.02 |
---|---|
Android Studio - RelativeLayout (0) | 2022.08.02 |
Android Studio - xml과 자바 (0) | 2022.08.02 |
Android Studio - 애뮬레이터 설치 및 Button 태그 (0) | 2022.08.01 |
Android Studio - 안드로이드 어플리케이션 기본과 UI (0) | 2022.08.01 |
댓글