Tushar
Tushar

Reputation: 5935

regarding placing 2 buttons on the left and right side in an xml file in android

I am developing an 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...

Upvotes: 0

Views: 221

Answers (2)

Rahul Kalidindi
Rahul Kalidindi

Reputation: 4736

If you want to align a list view below Button01

try

android:layout_below="@+id/Button01"

in the ListView

Upvotes: 0

Pinki
Pinki

Reputation: 21929

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>

Upvotes: 2

Related Questions