此前,当我进入做项目的时候!发现,当我进入到对应的ui中,焦点会自动的到edittext中,这样就会呼出软键盘!
解决的办法有2种:
1.在xml配置文件中添加代码,在顶层LinearLayout中加入2个属性
android:focusable="true"
android:focusableInTouchMode="true"
如此就可以取消自动聚集
2.在AndroidManifest.xml中添加代码,在相应的activity标签中加入这个属性:
android:windowSoftInputMode="stateHidden|adjustUnspecified"
这样也可以取消自动弹出软键盘