阻擋小鍵盤彈出
再寫APP的時候,如果UI原件裡有EditText一進到面就會自動跳出小鍵盤可以用以下方式阻擋
在layout的xml裡最"外層"的Layout,加入以下語法:
android:focusable="true"
android:focusableInTouchMode="true"
避免小鍵盤擋住EditText
在AndroidManifest.xml,加入
android:windowSoftInputMode="adjustPan"
ex:
<activity name="MainActivity"
android:windowSoftInputMode="adjustPan">
...
</activity>
當鍵盤彈出時,整個畫面layout會被向上推,輸入欄位的地方就不會被擋到
請先 登入 以發表留言。