android - Adding a listView between two elements -
i add listview between top , bottom button. don't want have fixed size, tried set way:
<button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparenttop="true" /> <listview android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@+id/button1" /> <button android:id="@+id/button2 android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" />
but when setting layout file way, listview of course below 1st button, goes there down button of screen, without stopping above button2. --> listview overlaps button2.
how can place listview between these 2 buttons?
add android:layout_above="@+id/button2"
attribute listview
follows...which keep listview
above button2
.
<button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparenttop="true" /> <listview android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@+id/button1" android:layout_above="@+id/button2" /> <button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" />
Comments
Post a Comment