代碼貼在這,但願能幫助你們。java
//初始狀態防止鍵盤彈起 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);