I dont know why but i cant get my button to show up after the listview. It does show fine in eclipse-graphical layout but when i launch the emulator the program crashes... here
Try not to use RelativeLayout
in such complex markup. Use LinearLayout
instead as baya described. RelativeLayout
is good when you want your widgets to lie on each other, for example dvd_box template and movie's cover on it.
And also if you use LinearLayout
distribute it's space between it's children using android:layout_weight
. It's realy useful and clear during reading your code if you express it in percentage terms.
<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent">
<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content">
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"/>
<TextView />
<TextView />
</RelativeLayout>
<ListView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" />
<Button android:layout_width="match_parent" android:layout_height="wrap_content"/>
<Button android:layout_width="match_parent" android:layout_height="wrap_content"/>
</LinearLayout>