1、manifest文件里面加 android:windowSoftInputMode="adjustResize|stateVisible" 2、布局文件最外层加 android:fitsSystemWindows="true"