我有一个 Android 活动,有一个EditText
在整个布局中。由于某种原因,每当活动开始时,键盘就会出现。
我努力了all以下事项:
-
将这两个放入OnStart
:
FindViewById<EditText> (Resource.Id.searchText).ClearFocus ();
FindViewById<EditText> (Resource.Id.searchText).Selected = false;
-
添加一个LinearLayout
具有这两个属性:
android:focusable="true" android:focusableInTouchMode="true"
-
在另一个标签中添加以下标签View
在布局上:
android:focusable="true" android:focusableInTouchMode="true"
-
将其添加到我的活动清单中:
android:windowSoftInputMode="stateHidden"
But still,当活动打开时键盘会打开。我可能做错了什么?
尝试这些Xamarin.Android
(跨平台)
this.Window.SetSoftInputMode (SoftInput.StateHidden);
Or
将其添加到清单中,
[Activity(Label = "SampleApp", MainLauncher = true, Icon = "@drawable/icon", WindowSoftInputMode = SoftInput.StateHidden)]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)