728x90
반응형
직접 풀어보기 5-4
![]() |
![]() |
렐러티브레이아웃, AVD 화면 | 중복 레이아웃, AVD 화면 |
<렐러티브레이아웃, xml 코드>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/Tcall"
android:text="전화번호"
android:textColor="@color/black"
android:layout_alignParentLeft="true"
android:layout_alignBaseline="@+id/ETcall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<EditText
android:id="@+id/ETcall"
android:layout_toRightOf="@+id/Tcall"
android:hint="000-0000-0000"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/btn1"
android:text="입력"
android:layout_below="@+id/ETcall"
android:layout_toLeftOf="@+id/btn2"
android:backgroundTint="#CDDC39"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/btn2"
android:text="취소"
android:layout_below="@+id/ETcall"
android:layout_alignParentRight="true"
android:backgroundTint="#CDDC39"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
<중복 리니어레이아웃, 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">
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_weight="12"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/Tcall"
android:text="전화번호"
android:layout_gravity="center"
android:textColor="@color/black"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:id="@+id/ETcall"
android:hint="000-0000-0000"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/btn1"
android:text="입력"
android:backgroundTint="#CDDC39"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_weight="1.5"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/btn2"
android:text="취소"
android:backgroundTint="#CDDC39"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
</LinearLayout>
'모바일 > android' 카테고리의 다른 글
[안드로이드프로그래밍6판] 6장 실습 6-1, 직접 풀어보기 6-1 (0) | 2021.10.17 |
---|---|
[안드로이드프로그래밍6판] 5장 실습 5-2, 직접 풀어보기 5-5 (0) | 2021.10.16 |
[안드로이드프로그래밍6판] 5장 직접 풀어보기 5-2, 실습 5-1 (0) | 2021.10.16 |
[안드로이드프로그래밍6판] 4장 연습 문제 7, 8 (0) | 2021.10.16 |
[안드로이드프로그래밍6판] 4장 실습 4-2, 직접 풀어보기 4-4 (0) | 2021.10.16 |
728x90
반응형
직접 풀어보기 5-4
![]() |
![]() |
렐러티브레이아웃, AVD 화면 | 중복 레이아웃, AVD 화면 |
<렐러티브레이아웃, xml 코드>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/Tcall"
android:text="전화번호"
android:textColor="@color/black"
android:layout_alignParentLeft="true"
android:layout_alignBaseline="@+id/ETcall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<EditText
android:id="@+id/ETcall"
android:layout_toRightOf="@+id/Tcall"
android:hint="000-0000-0000"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/btn1"
android:text="입력"
android:layout_below="@+id/ETcall"
android:layout_toLeftOf="@+id/btn2"
android:backgroundTint="#CDDC39"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/btn2"
android:text="취소"
android:layout_below="@+id/ETcall"
android:layout_alignParentRight="true"
android:backgroundTint="#CDDC39"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
<중복 리니어레이아웃, 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">
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_weight="12"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/Tcall"
android:text="전화번호"
android:layout_gravity="center"
android:textColor="@color/black"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:id="@+id/ETcall"
android:hint="000-0000-0000"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/btn1"
android:text="입력"
android:backgroundTint="#CDDC39"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_weight="1.5"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/btn2"
android:text="취소"
android:backgroundTint="#CDDC39"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
</LinearLayout>
'모바일 > android' 카테고리의 다른 글
[안드로이드프로그래밍6판] 6장 실습 6-1, 직접 풀어보기 6-1 (0) | 2021.10.17 |
---|---|
[안드로이드프로그래밍6판] 5장 실습 5-2, 직접 풀어보기 5-5 (0) | 2021.10.16 |
[안드로이드프로그래밍6판] 5장 직접 풀어보기 5-2, 실습 5-1 (0) | 2021.10.16 |
[안드로이드프로그래밍6판] 4장 연습 문제 7, 8 (0) | 2021.10.16 |
[안드로이드프로그래밍6판] 4장 실습 4-2, 직접 풀어보기 4-4 (0) | 2021.10.16 |