XML : How to use layout_below in RelativeLayout?

Here is my code(not all code,i have deleted some):

  <RelativeLayout          android:id="@+id/info_in_my"          android:layout_width="match_parent"          android:layout_height="wrap_content"          android:layout_below="@id/head_in_my"          android:layout_marginTop="@dimen/spacing_size_36dp"          >          <ImageView              android:id="@+id/pic_in_my"              android:layout_width="wrap_content"              android:layout_height="wrap_content"              android:layout_marginStart="@dimen/spacing_size_36dp"              android:layout_alignParentStart="true"              android:src="@mipmap/icon_policeman"              />          <TextView              android:id="@+id/name_in_my"              android:layout_width="wrap_content"              android:layout_height="wrap_content"              android:text="AAAAAA"              android:layout_toEndOf="@id/pic_in_my"              android:layout_centerInParent="true"              android:textColor="@color/font_white"              android:textSize="@dimen/font_size_18sp"              />          <TextView              android:id="@+id/organization_in_my"              android:layout_width="wrap_content"              android:layout_height="wrap_content"              android:text="BBBBBBBBBBBBBBBBB"              android:layout_below="@+id/name_in_my"              android:layout_toEndOf="@+id/pic_in_my"              android:textSize="@dimen/font_size_12sp"              android:textColor="@color/font_white"              />      </RelativeLayout>    

This is result: enter image description here

I want String BBBBBBBBB is below String AAAAAA so it's not right. And i delete android:layout_centerInParent="true" in first TextView not changes. Dose android:layout_below="@+id/name_in_my" is useless when First View uses android:layout_centerInParent="true" I want to know why????

No comments:

Post a Comment