在布局文件根目录加入android:fitsSystemWindows="true"即可
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ComplainActivity"
android:background="@color/color_F0F0F0"
android:orientation="vertical"
android:fitsSystemWindows="true"
>