[안드로이드] 회원가입 화면 그리기 연습

2020. 8. 28. 17:35·공부/Kotlin

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
    android:padding="15dp"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFFFFF"
    tools:context=".MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="아이디" />

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="이메일 양식으로 입력"
        android:inputType="textEmailAddress" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="비밀번호" />

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="8자리 이상 입력"
        android:inputType="numberPassword" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="닉네임" />

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="한글도 입력 가능"
        android:singleLine="true" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="성별"/>
    <RadioGroup
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <RadioButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="여성"/>
        <RadioButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="남성"/>
        <RadioButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:enabled="false"
            android:text="비공개" />
    </RadioGroup>

    <CheckBox
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:checked="true"
        android:text="이용 약관 동의"/>
    <CheckBox
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="마케팅 정보 활용 동의" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="0dp"
        android:layout_weight="1"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="vertical" >

        <ImageView
            android:layout_width="150dp"
            android:layout_height="150dp"
            android:scaleType="centerCrop"
            android:src="@drawable/android"/>

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <Button
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:text="이전으로" />
        <Button
            android:layout_width="0dp"
            android:layout_weight="3"
            android:layout_height="wrap_content"
            android:text="회원 가입"/>
    </LinearLayout>
</LinearLayout>

 

입력받는 태그는 EditText를 사용한다.

사용자에게 입력 방식을 이야기 하고 싶다면 hint 속성을 사용하여 작성해주면 된다.

2020/08/28 - [프로그래밍언어/Kotlin] - [안드로이드] 에디트 텍스트(EditText)

 

[안드로이드] 에디트 텍스트(EditText)

개요 Text: 문구(String)를 다루려고 할 때 사용 Edit: 수정하다 => 앱을 쓰는 일반 사용자가 수정할 수 있다 사용자에게 문구(String)을 입력받고 싶을 때 배치하는 뷰 => JAVA 초급 : Scanner 클래스에 대응�

90052.tistory.com

 

라디오 버튼은 그룹으로 묶어서 하나를 택했다면, 다른 하나를 택하지 못하게 해준다.

만약 선택하지 못하게 막고 싶다면 enabled='false'를 적용해주면 된다.

 

체크박스는 각각 선택이 가능해야 하므로 그룹으로 묶지 않는다.

미리 체크를 해두고 싶다면 checked='true'를 이용한다.

 

회원가입 버튼은 Button 태그를 사용한다.

버튼안에 원하는 문구를 넣고 싶다면 text 속성을 이용한다.

2020/08/28 - [프로그래밍언어/Kotlin] - [안드로이드] 버튼 태그(Button)

 

[안드로이드] 버튼 태그(Button)

개요 사용자에게 클릭(터치) 이벤트를 받을 목적으로 배치 입력을 마쳤다 or 다른 행동을 실행해달라 등등의 사용자가 의사표현을 하는 용도로 배치 종류 Button: 제일 기본이 되는 버튼: text 속성�

90052.tistory.com

 

상대 비율로 배치를 원한다면 원하는 가로/세로 길이를 0으로 적어준 다음 weight=0으로 쓰면 된다.

위와 같이 이전으로 버튼과 회원가입 버튼을 1:3 비율로 나란히 두고 싶다면?

LinearLayout에 orientation="horizontal" 적용하여 새로 만들어주고

width = 0

weight = 1

 

이미지는 ImageView를 사용했다.

2020/08/28 - [프로그래밍언어/Kotlin] - [안드로이드] 이미지뷰(ImageView)

 

[안드로이드] 이미지뷰(ImageView)

개요 사용자에게 그림 파일을 보여줄 때 사용 개발을 할 때, 미리 지정되어 있는 디자인으로써의 그림을 보여주는 방법 프로젝트에 그림파일을 추가하는 방법 원하는 그림파일 다운 => 파일 이��

90052.tistory.com

 

'공부 > Kotlin' 카테고리의 다른 글

[안드로이드] 에디트 텍스트(EditText)  (0) 2020.08.28
[안드로이드] 버튼 태그(Button)  (0) 2020.08.28
[안드로이드] 텍스트 뷰(TextView)  (0) 2020.08.28
[안드로이드] 화면 구현 기초  (0) 2020.08.28
[안드로이드 스튜디오] 프로젝트의 구조  (0) 2020.08.27
'공부/Kotlin' 카테고리의 다른 글
  • [안드로이드] 에디트 텍스트(EditText)
  • [안드로이드] 버튼 태그(Button)
  • [안드로이드] 텍스트 뷰(TextView)
  • [안드로이드] 화면 구현 기초
ompeom
ompeom
  • ompeom
    괴발개발 공부하는 블로그
    ompeom
  • 전체
    오늘
    어제
    • 분류 전체보기 (34)
      • 공부 (18)
        • Python (2)
        • Java (0)
        • Kotlin (14)
        • Spring batch (2)
        • Spring (0)
      • 기타 (8)
      • 프로젝트 (8)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    튜플
    세트
    Python
    딕셔너리
    내장함수
    TDD강의
    NextSTEP
    자료형
    리스트
    파이썬
    넥스트스탭
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
ompeom
[안드로이드] 회원가입 화면 그리기 연습
상단으로

티스토리툴바

단축키

내 블로그

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

블로그 게시글

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

모든 영역

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

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