【发布时间】:2018-02-10 01:14:25
【问题描述】:
我希望EditText 在专注于 Android Wear 时不要扩展 IME。
我以与以下线程相同的方式阅读和实现:
Prevent EditText from automatically focusing
但是,会出现 IME。
在 Android Wear 上是否无法隐藏 EditText 的 IME?
我尝试了 3 种方法:
-
在 onCreate() 方法中添加如下代码:
{getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);} -
在AndroidManifest.xml的activity标签中添加如下代码
android:windowSoftInputMode="stateAlwaysHidden" -
在rect_activity_main.xml中添加如下代码
<LinearLayout android:layout_width="0dp" android:layout_height="0dp" android:background="@android:color/transparent" android:focusable="true" android:focusableInTouchMode="true"/>
它们都不起作用。
最好的问候,gellpro
【问题讨论】: