regarding placing 2 buttons on the left and right side in an xml file in android
I am developing a开发者_JAVA百科n application.I have 2 buttons in it back and item.I want to place a list below the buttons.How can i do this in xml file?Can anyone tell me...
try below code
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android" android:background="@drawable/background">
<LinearLayout
android:id="@+id/LinearLayoutIcons"
android:layout_height="wrap_content" android:layout_width="fill_parent" android:gravity="center_horizontal">
<Button android:text="@+id/Button01" android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button><Button android:text="@+id/Button02" android:id="@+id/Button02" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</LinearLayout>
<ListView
android:id="@+id/ListViewMessage"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ListView>
</LinearLayout>
If you want to align a list view below Button01
try
android:layout_below="@+id/Button01"
in the ListView
精彩评论