Saturday, 19 July 2014

Insert ListView between two buttons in Android XML



I have a concept xml as shown below, how to insert listview in between two buttons? enter image description here


This my xml code, What should I add or change in its code?


main.xlm



<!-- main.xml -->
<RelativeLayout xmlns:android="http://ift.tt/nIICcg"
xmlns:tools="http://ift.tt/LrGmb4"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Main" >
<Button android:text="Back To Main Menu"
android:id="@+id/btn_add_contact"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"/>

<ListView
android:id="@+id/lv_contact_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/btn_add_contact"/>

<Button android:text="Add New Moment"
android:id="@+id/btn_add_contact"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="false"/>



</RelativeLayout>

No comments:

Post a Comment