Ard*_*rdi 24 android android-design-library
我在NavigationDrawer中使用TextInputLayout(+ search).当用户切换此抽屉时,光标焦点会立即显示在TextInputLayout字段上.
在用户点击之前,是否有可能不关注此字段?
谢谢 !
小智 49
在根视图中使用此属性:
android:focusableInTouchMode="true"
Run Code Online (Sandbox Code Playgroud)
在我的情况下,所有答案都没有帮助。我所做的是以下内容:
editText.post(() -> {
textInputLayout.setHintAnimationEnabled(false);
editText.clearFocus();
textInputLayout.setHintAnimationEnabled(true);
});
Run Code Online (Sandbox Code Playgroud)
这从设计支持库 v23 开始可用。