先创建一个title.xml
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ic_launcher_foreground"
>
<!--background可以放图片,放了合适的图片比较好看,这里我比较随意点,没找到资源-->
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/title_Back"
android:layout_margin