lundi 26 mai 2014

Android: fill relative layout height (item layout) inside ListView


Vote count:

0




I'm not able to make a View that fill the height of a RelativeLayout, which is the layout of ListView items. Here is my layout:



<RelativeLayout xmlns:android="http://ift.tt/nIICcg"
android:layout_width="match_parent"
android:layout_height="wrap_content" >

<View
android:id="@+id/delivery_list_item_statusBtn"
android:layout_width="15dp"
android:layout_height="match_parent"
android:background="@color/red"/>

<TextView
android:id="@+id/delivery_list_item_dest"
android:layout_width="wrap_content"
android:layout_toRightOf="@id/delivery_list_item_statusBtn"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="2dp"
android:text="Destinatario" />

<TextView
android:id="@+id/delivery_list_item_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/delivery_list_item_dest"
android:layout_below="@id/delivery_list_item_dest"
android:layout_marginTop="5dp"
android:layout_marginRight="5dp"
android:text="Location" />

<ImageButton
android:id="@+id/delivery_list_item_mapBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="0dp"
android:src="@drawable/map_location"
android:background="@null" />


View with id fill_the_height_please not fill the item height. In figure below you can see the result (nothing is shown):


enter image description here


I'd like something like this:


enter image description hereù


I have also try to change view layout as follows but not works anyway:



<View
android:id="@+id/fill_the_height_please"
android:layout_width="15dp"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:background="@color/red"/>


Please can you help to achieve my goal? Thank you.



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire