使用RelativeLayout对齐三个元素

Han*_*nzo 3 android

我正在尝试对齐三个元素,第一个在左边缘(Imageview),在中心,Textview为一个Tittle,右边缘为Imageview.

这是代码

<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="@color/fondo_main"
    android:orientation="vertical" >

    <RelativeLayout
        android:id="@+id/RelativeLayout01"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginBottom="5dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="5dp"
        android:layout_weight="1" >


        <ImageView
            android:id="@+id/buttonback"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:src="@drawable/back" />
        <TextView
            android:id="@+id/tittle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" 
            android:text="Tittle"
        android:textColor="@color/azul_asde"
            android:src="@drawable/upload" />
        <ImageView
            android:id="@+id/buttonupload"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:src="@drawable/upload" />
    </RelativeLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

如何在中心对齐?

Son*_*890 8

把它放在Textview中

 android:layout_centerHorizontal="true"
Run Code Online (Sandbox Code Playgroud)