모바일/android

[안드로이드프로그래밍6판] 5장 직접 풀어보기 5-4

2021. 10. 16. 12:43
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
'모바일/android' 카테고리의 다른 글
  • [안드로이드프로그래밍6판] 6장 실습 6-1, 직접 풀어보기 6-1
  • [안드로이드프로그래밍6판] 5장 실습 5-2, 직접 풀어보기 5-5
  • [안드로이드프로그래밍6판] 5장 직접 풀어보기 5-2, 실습 5-1
  • [안드로이드프로그래밍6판] 4장 연습 문제 7, 8
hatch
hatch
250x250
hatch
차근차근 쌓아올리는,
hatch
전체
오늘
어제
  • 분류 전체보기 (121)
    • TIL (3)
    • [JAVA] (17)
      • 생활코딩 (11)
    • 모바일 (25)
      • android (24)
      • ReactNative (1)
    • 웹개발 (25)
      • React (3)
      • jQuery (5)
      • Springboot (2)
    • 알고리즘 (42)
    • [프로그래밍기초지식] (1)
    • [기술문서 읽기] (0)
      • 개념 번역 (0)
    • 인사이트(insight) (2)
    • git (2)

블로그 메뉴

  • 홈
  • 태그
  • 방명록
  • write
  • manger

공지사항

인기 글

태그

  • Doit!자바프로그래밍입문
  • 중복리니어레이아웃
  • 재귀
  • 타일링
  • 210908
  • 명시적 인텐트
  • state
  • 모프2주차
  • 안드로이드프로그래밍6판
  • 반복문
  • BufferedReader
  • 깊은복사
  • 별찍기
  • 노이클립스
  • javascript
  • 백준
  • TIL
  • DP
  • scanf
  • jquery

최근 댓글

최근 글

hELLO · Designed By 정상우.
hatch
[안드로이드프로그래밍6판] 5장 직접 풀어보기 5-4
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.