安卓EditText自动获取焦点并弹出软键盘
2020-10-11 本文已影响0人
蓝不蓝编程
private fun showSoftInputFromWindow(editText: EditText) {
editText.isFocusable = true
editText.isFocusableInTouchMode = true
editText.requestFocus()
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
}