Hi all,
I want to put three buttons in one single line with the left and the right
button at a fixed size, and the middle button wich take the distance between
the two buttons. My application will work in different device, so I can't
fix the size, it has to be adaptative...
Here is my current code :
<RelativeLayout android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:gravity="center">
<Button android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="@string/lbl_help"
android:gravity="center"
android:background="@drawable/btn_grey_9p"
android:textColor="#cccccc"
android:textSize="18dp"
android:layout_margin="1dp"
android:layout_alignParentLeft="true"/>
<LinearLayout android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:gravity="center"
android:layout_centerInParent="true">
<Button android:id="@+id/btnApply"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:text="@string/protect_me"
android:gravity="center"
android:background="@drawable/btn_bottom"
android:textColor="#ffffff"
android:textStyle="bold"
android:textSize="18dp"
android:layout_marginTop="1dp"/>
</LinearLayout>
<Button android:id="@+id/btnLocate"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:gravity="center"
android:background="@drawable/btn_bottom"
android:textColor="#ffffff"
android:textSize="18dp"
android:text="@string/btn_locate"
android:layout_margin="1dp"
android:layout_alignParentRight="true"/>
</RelativeLayout>
For the moment, the size is fixed (in red in the code). If I use a
LinearLayout, with the middle button widht parameter :
'android:layout_width="fill_parent"' It start at the right of the left
button (OK) but overwrite the right button (NOT OK)
Anyone can help me ?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en