方法一
在mainfest文件设置activity属性
android:windowSoftInputMode="stateHidden"
方法二
在布局文件中使焦点在其他控件上
<TextView
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_width="wrap_content"
android:layout_height="0dp">
<requestFocus/>
</TextView>
在mainfest文件设置activity属性
android:windowSoftInputMode="stateHidden"
方法二
在布局文件中使焦点在其他控件上
<TextView
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_width="wrap_content"
android:layout_height="0dp">
<requestFocus/>
</TextView>
本文介绍了两种在Android应用中隐藏软键盘的方法:一种是在manifest文件中为Activity设置特定属性;另一种是在布局文件中通过调整控件焦点实现。
2776

被折叠的 条评论
为什么被折叠?



