Java 当EditText处于焦点时如何隐藏输入法
我希望Java 当EditText处于焦点时如何隐藏输入法,java,android,wear-os,ime,Java,Android,Wear Os,Ime,我希望EditText在专注于Android Wear时不要扩展IME。 我以与以下线程相同的方式阅读和实现: 然而,IME出现了。 在Android Wear上是否无法隐藏EditText的输入法 我尝试了3种方法: 在onCreate()方法中添加了以下代码: 在AndroidManifest.xml中的活动标记中添加了以下代码 android:windowSoftInputMode="stateAlwaysHidden" 在rect_activity_main.xml中添加了以下代
EditText
在专注于Android Wear时不要扩展IME。
我以与以下线程相同的方式阅读和实现:
然而,IME出现了。
在Android Wear上是否无法隐藏EditText
的输入法
我尝试了3种方法:
android:windowSoftInputMode="stateAlwaysHidden"
<LinearLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@android:color/transparent"
android:focusable="true" android:focusableInTouchMode="true"/>
android:windowSoftInputMode
属性和一个“adjust”值
然后,要实现隐藏IME,请尝试使用将常量设置为RESULT\u UNCHANGED\u HIDDEN
。这将为ResultReceiver
showSoftInput(View,int,ResultReceiver)和hideSoftInputFromWindow(IBinder,int,ResultReceiver)
中的ResultReceiver标记:软输入窗口的状态保持不变且保持隐藏状态
希望有帮助。检查。需要注意的是,当用户在测试字段中完成任务时,系统会隐藏输入法,或者用户可以使用系统控件将其隐藏。用这个,试着去做。提到过,
要声明活动中的首选处理方式,请使用清单元素中的android:windowSoftInputMode
属性和一个“adjust”值
然后,要实现隐藏IME,请尝试使用将常量设置为RESULT\u UNCHANGED\u HIDDEN
。这将为ResultReceiver
showSoftInput(View,int,ResultReceiver)
和hideSoftInputFromWindow(IBinder,int,ResultReceiver)
中的ResultReceiver标记:软输入窗口的状态保持不变且保持隐藏状态
希望这能有所帮助。检查一下这个。。检查一下这个。。
<LinearLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@android:color/transparent"
android:focusable="true" android:focusableInTouchMode="true"/>