我试图对齐三个元素,第一个位于左边缘(Imageview),中间的文字视图为标题,右边缘为Imageview。使用RelativeLayout对齐三个元素
这是代码
<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>
我怎么能在中心对齐丝毫不差?
你可能想看看我的更新答案。 :) – SMR