I’m trying to create a view with 2 buttons on top(1 at left hand side of the screen and other on right side),a gesture overlay in between and another button at the bottom right of the screen.
Here the top right button isn’t being placed on the right.. please help..
here is my code
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
>
<LinearLayout android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/linearLayout1">
<ImageButton android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="@drawable/add"
android:id="@+id/bBlog"></ImageButton>
<ImageButton android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_gravity="right" android:background="@drawable/view" android:id="@+id/bBlog"></ImageButton>
</LinearLayout>
<RelativeLayout android:layout_height="fill_parent" android:layout_width="match_parent">
<android.gesture.GestureOverlayView android:layout_alignParentRight="true"
android:id="@+id/myoverlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gestureColor="#000333"/>
<ImageButton android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon"
android:id="@+id/exit"></ImageButton>
</RelativeLayout>
</LinearLayout>
Try using a RelativeLayout with layout_alignParentLeft and layout_alignParentRight as such:
Of course, you can add padding in there as necessary.