1.方法一:在配置文件中设置
android:windowSoftInputMode="stateHidden"
2.方法二: 在一xml布局中添加一个LinearLayout
<LinearLayout
android:layout_width="0px"
android:layout_height="0px"
android:focusable="true"
android:focusableInTouchMode="true" />
关于focusableInTouchMode和 focusable 属性可以参考 android:focusable和android:focusableInTouchMode的区别
本文介绍了两种在Android应用中隐藏软键盘的方法:一种是在配置文件中设置特定参数;另一种是在XML布局文件中添加一个特殊的LinearLayout元素,通过调整该元素的属性实现键盘的自动隐藏。
1166

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



