mardi 5 mai 2015

RelativeLayout layout issue in Item Layout of ListView

I am working with a ListView item layout,and stuck with this problem,can't arrange child position in a Relativelayout

Here is my Item Layout frame

blob:https%3A//http://ift.tt/1EclWsg

I want One ImageView on the top,One TextView in center,and One ImageView on bottom.

Here is my layout code(The Green RelativeLayout)

<RelativeLayout
              android:id="@+id/bub_right"
              android:layout_width="30dip"
              android:layout_height="wrap_content"
              android:layout_alignTop="@id/bub_left"
              android:layout_alignBottom="@id/bub_left"
              android:layout_alignParentEnd="true"
              android:layout_alignParentRight="true"
              android:background="#666666"
              android:gravity="right">
              <ImageView
                  android:layout_width="30dip"
                  android:layout_height="20dip"
                  android:id="@+id/bub_up"
                  android:layout_alignParentTop="true"
                  android:src="@drawable/up"/>
              <TextView
                  android:layout_width="30dip"
                  android:layout_height="20dip"
                  android:text="123"
                  android:layout_centerVertical="true"
                  android:id="@+id/bub_score"
                  android:textSize="15dp"/>
              <ImageView
                  android:id="@+id/bub_down"
                  android:layout_width="30dip"
                  android:layout_alignParentBottom="true"
                  android:layout_height="20dip"
                  android:src="@drawable/down"/>
 </RelativeLayout>

I set this two lines to make sure The Green Relativelayout got same height with the Redone.

     android:layout_alignTop="@id/bub_left"
     android:layout_alignBottom="@id/bub_left"

And the result is like this: blob:https%3A//http://ift.tt/1R8NGb9

Please help, Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire