EditText 속성
- background 값에 @null을 추가한다.
EditText 활성화, 키패드 보이기, 커서 위치 이동
editText.isFocusableInTouchMode = true
editText.isFocusable = true
editText.selection(editText.length()) // 커서 위치 이동하기
// 키패드 보이기
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.showSoftInput(eidtText, 0)
EditText 비활성화, 키패드 숨기기
editText.isClickable = false
editText.isFocusable = false
// 키패드 숨기기
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(edit_nickname_editmyinfo_a.windowToken, 0)
Reference
- https://nuggy875.tistory.com/10
- https://philip1994.tistory.com/12
- https://programmingsummaries.tistory.com/30
'Android' 카테고리의 다른 글
[안드로이드] “android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application” (0) | 2020.02.18 |
---|---|
[안드로이드] 버튼 텍스트 소문자, uCrop (0) | 2020.02.16 |
[안드로이드] ContentProvider (0) | 2020.02.12 |
[안드로이드] 이벤트 이해하기 (0) | 2020.01.04 |
[안드로이드] 어떤 색상을 활용하는게 좋을까? (0) | 2019.11.30 |