Android 編程下的 EditView 阻止軟鍵盤自動彈出__圖片資源文件後綴不能爲.ico

EditText 在 Activity 啓動後自動獲得焦點會激活軟鍵盤的顯示,如想屏蔽或者阻止軟鍵盤的自動彈出,可以找到 EditText 所在 Activity 在 AndroidManifest.xml 的配置信息給對應 Activity 添加屬性 android:windowSoftInputMode="adjustUnspecified|stateHidden" 即可實現,代碼如下:

<activity
    android:name=".act.ActLogin"
    android:screenOrientation="portrait"
    android:windowSoftInputMode="adjustUnspecified|stateHidden" />

或者在其父控件下,添加如下的屬性:

android:focusable="true"   android:focusableInTouchMode="true"

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章