Possible Duplicate:
Button half width of screen
I want to create two buttons inside a linear layer (horizontal orientation), each one having the half width of the screen, and also a little margin. I have this xml layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/txtTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingTop="5dp"
android:text="@string/Title" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|fill_horizontal"
android:orientation="horizontal"
android:padding="2dp" >
<Button
android:id="@+id/btnLeft"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:layout_weight="1"
android:text="@string/LeftButton" />
<Button
android:id="@+id/btnRight"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:layout_weight="1"
android:text="@string/RightButton" />
</LinearLayout>
</LinearLayout>
Well, all this code works perfectly for what I want but I get a warning about my two buttons. It says that "Nested weights are bad for performance". I know what is it about but I don't know how to change my layout in order to get rid of the warning (and improve performance, I suppose) and keep both buttons having the half of the screen.
Any ideas? Thanks!