剛進入activity的時候,如果佈局組件有edittext的話,往往edittext會獲取焦點,自動彈出軟鍵盤,影響整個界面的視覺效果。解決方法如下:
可以在edittext的父佈局結構中(例如LinearLayout,RelativeLayout等)添加
Android:focusable=”true”
android:focusableInTouchMode=”true”
這個兩個屬性,就可以了。
轉自: [程序員小冰] 的博客(http://blog.csdn.net/qq_21376985/article/details/51161666)