I want make 2 button take half of the screen width, but what ever i tru only one button came in screen and take full screenwidth. I wanted it for all resolution so dont want to make fix width. one button will take left half and other will take right half how it can do
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button"
android:layout_gravity="left" />
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button"
android:layout_gravity="right" />
</LinearLayout>
</ScrollView>