1. 작성하는 코드
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<androidx.appcompat.widget.LinearLayoutCompat
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="80dp">
<Button
android:id="@+id/button1"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:text="Button" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/button3"
android:layout_width="match_parent"
android:layout_height="300dp"
android:text="Button" />
<androidx.appcompat.widget.LinearLayoutCompat
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="50dp">
<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button" />
<Button
android:id="@+id/button5"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button" />
<Button
android:id="@+id/button6"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="50dp">
<Button
android:id="@+id/button7"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button" />
<Button
android:id="@+id/button8"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
2. 완성된 화면 예제
'Android > work' 카테고리의 다른 글
[UI구현 실습] 인스타그램 로그인 화면 (0) | 2021.08.02 |
---|---|
[실습02] 계산기 앱 만들기 (미완성) (0) | 2021.07.28 |
[실습01] 인스타그램 포스트 UI구현 (0) | 2021.07.28 |
[] : post_item (0) | 2021.07.26 |