EditText 小鍵盤彈出

1.在editText外layout上加上可讓其可以取得焦點

android:focusable="true"

android:focusableInTouchMode="true"

由於(android:focusableInTouchMode)設置為true (android:focusable)必定為ture 所以可以省略



2.在onCread 加入
//鍵盤 不自動彈出
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
//鍵盤 不擠壓畫面
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

3.dialog 中
與2大致相同 dialog.getWindow()..... 

留言