안드로이드/기본 위젯
에디트텍스트
kitty_cat
2023. 3. 9. 19:36
입력상자의 역할을 하며, 글자를 입력하려고 커서를 옮기면 키패드가 화면에 나옴.
inputType 속성을 통해서 입력하는 문자의 유형을 지정할 수 있음
hint 속성 : 에디트텍스트에 간단한 표시글이 연하게 표시됨. 해당 안내글은 사용자의 입력이 전환되면 사라짐.
inputType 속성 : 입력되는 글자의 유형을 정의할 수 있음. 입력할 때 보이는 키패드의 유형을 정할 수 있음.\
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:id="@+id/editTextTextPersonName3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="24sp"
android:inputType="text"
android:hint="이름을 입력하세요"
android:text="" />
</LinearLayout>