这是MainActivity布局
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="52dp" android:id="@+id/layout_titlebar" android:background="#ed4255" tools:context="com.example.titleactivitydemo.TitleActivity"> <TextView android:id="@+id/title" android:layout_width="match_parent" android:layout_height="match_parent"