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

 

+ Recent posts