<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/title_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:background="@drawable/left"
android:textColor="#fff"
android:text="Back" />
<TextView
android:id="@+id/title_text"
android:layout_gravity="center"
android:layout_width="0dip"
android:layout_weight="1"
android:textSize="24sp"
android:textColor="#555"
android:layout_height="wrap_content"
android:text="Title Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="@+id/title_edit"
android:layout_gravity="center"
android:layout_margin="5dip"
android:background="@drawable/right"
android:textColor="#fff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Edit" />
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/title_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:background="@drawable/left"
android:textColor="#fff"
android:text="Back" />
<TextView
android:id="@+id/title_text"
android:layout_gravity="center"
android:layout_width="0dip"
android:layout_weight="1"
android:textSize="24sp"
android:textColor="#555"
android:layout_height="wrap_content"
android:text="Title Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="@+id/title_edit"
android:layout_gravity="center"
android:layout_margin="5dip"
android:background="@drawable/right"
android:textColor="#fff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Edit" />
</LinearLayout>
在主界面中
<include
android:layout_width="156dp"
layout="@layout/title" />