EditText의 옵션에 따라서 기본 키패드 옵션이 달라지게 된다.
// 문자열 추가
android:text="@string/str_dot"
// 텍스트 정렬 , 색상, 크기, style(bold, normal, italic), 입력 가능 문자
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="50dp"
android:textStyle="normal"
android:maxLength="6"
// 비밀번호 입력 타입(영어)
android:inputType="textPassword"
// 숫자 키패드
android:inputType="number"
// 이메일 키패드(영어, @)
android:inputType="textEmailAddress"
// 일반적인 키패드(설정된 언어 우선)
android:inputType="text"
// 만약 기존에 설정된 언어보다는 영어가 더 어울리는 textField의 경우(like url)
android:privateImeOptions="defaultInputmode=english"
// 여러 줄에 대한 처리
android:inputType="textMultiLine"
android:lines="5"
// 한 줄 처리
android:singleLine="true"
// 텍스트가 빈 경우에 출력한 hint
android:hint="@string/aaa"
// 키패드 내에서 버튼을 actionNext로 처리
// inputType="textMultiLine" 속성을 사용하는 경우에는 추가하지 말 것(줄 내림 불가)
android:imeOptions="actionNext"
// Next 버튼을 누르면 다음 EditText에 포커싱을 주는 처리
fun openIME(editText: EditText, context: Context)
{
val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
editText.requestFocus()
imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT)
}
기타 옵션
// 폰트 내의 패딩을 없애기
android:includeFontPadding="false"
'프로그래밍 > Android, iOS' 카테고리의 다른 글
[Android] Resize Bitmap (0) | 2022.05.11 |
---|---|
[Android] Network status (0) | 2022.05.01 |
[Google Play Store] 어플 키워드 관련 정리 (0) | 2022.03.31 |
[Android] 2차 인증(2 factor authentication) (0) | 2022.03.30 |
[Android] Toolbar padding in Tablet (0) | 2022.03.30 |
댓글