Dr.vafa Dr.vafa - 1 month ago 24
Android Question

Disable focus hint of textInputLayout

I use attributes :

xml attributes of textinputlayout or edittext :

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


and AndroidManifest:
android:windowSoftInputMode="stateAlwaysHidden"


java code :

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


But not work
buil tools version 25 (i use pre 25 but Still don't work)

when load app
enter image description here

on focus in editText enter image description here

Answer

Try setting :

android:focusableInTouchMode = "true" 

for root/parent view and not for textInputLayout or editText itself.

That should work !

Comments