禁用textInputLayout的焦点提示

时间:2016-10-26 19:47:38

标签: android android-edittext android-textinputlayout

我使用属性:

textinputlayout或edittext的

xml属性

android:descendantFocusability ="beforeDescandants"; android:focusableInTouchMod="true"

AndroidManifest android:windowSoftInputMode="stateAlwaysHidden"

java code

mEditText.setCursorVisible(false); mEditText.clearFocus(); this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

但不行 构建工具版本25(我使用前25但仍然没有工作)

加载应用时

enter image description here

焦点在editText

enter image description here

1 个答案:

答案 0 :(得分:2)

尝试设置:

android:focusableInTouchMode = "true" 

用于root /父视图,而不是textInputLayout或editText本身。

这应该有用!

相关问题