본문 바로가기
프로그래밍/App 개발

[Android] letter capitalization + done button

by 엽기토기 2023. 2. 10.
반응형

 In EditText, apply keyboard first letter capitalization option along with changing to done button

EditText에서 완료 버튼으로 변경과 함께 키보드 첫 글자 대문자 옵션 적용

 

You cannot apply the above two functions together from EditText to xml.

However, if implemented programmatically with kotlin as below, it works normally.

 

fun EditText.setImeDone() {
    imeOptions = EditorInfo.IME_ACTION_DONE
    setRawInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE or EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES)
    isSingleLine = false
}
 
반응형