layout设置 :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"android:layout_gravity="fill_horizontal"
android:orientation="horizontal"
android:layout_height="fill_parent" >
<Button android:id="@+id/header_left_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="5dp"
android:layout_centerVertical="true"
android:text="返回"
android:textColor="#000000"/>
<TextView android:id="@+id/header_text"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_toRightOf="@+id/header_left_btn"
android:layout_toLeftOf="@+id/header_right_btn"
android:text="My Title Bar"
android:textSize="20sp"
android:textStyle="bold"
android:textColor="#FFFFFF"
android:gravity="center"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:singleLine="true" />
<Button android:id="@+id/header_right_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="5dp"
android:layout_centerVertical="true"
android:text="图片"
android:textColor="#000000"/>
</RelativeLayout>