I run into the following issue:
I have an activity which is set up in the landscape mode in this way:
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
And here is my xml file:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal">
<RelativeLayout android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:id="@+id/first"
android:orientation="vertical"
android:layout_weight="1.0">
<SurfaceView android:layout_width="fill_parent"
android:layout_height="fill_parent" android:id="@+id/surface_camera" />
</RelativeLayout>
<RelativeLayout android:layout_width="180dp"
android:layout_height="fill_parent"
>
<Button android:layout_width="fill_parent"
android:layout_height="320dip"
android:id="@+id/btnPhoto"
android:text="Take Photo"
android:layout_gravity="bottom|left" />
</RelativeLayout>
</RelativeLayout>
And here is how the result looks like:
http://i56.tinypic.com/21103ld.png
What I want is that button to be set up at the bottom of the screen(!from my point of view).
But I don’t know how to achieve that.Thanks
EDIT1:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"
>
<SurfaceView android:layout_width="fill_parent"
android:layout_height="fill_parent" android:id="@+id/surface_camera" />
<RelativeLayout android:layout_width="180dp"
android:layout_height="fill_parent"
>
<Button android:layout_width="fill_parent"
android:layout_height="320dip"
android:id="@+id/btnPhoto"
android:layout_alignParentBottom="true"
android:text="Take Photo"
android:layout_gravity="bottom|left" />
</RelativeLayout>
</RelativeLayout>
SOLUTION:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"
>
<SurfaceView android:layout_width="450dip"
android:layout_height="fill_parent" android:id="@+id/surface_camera" />
<RelativeLayout android:layout_width="180dp"
android:layout_toRightOf="@id/surface_camera"
android:layout_height="fill_parent"
>
<Button android:layout_width="fill_parent"
android:layout_height="320dip"
android:id="@+id/btnPhoto"
android:layout_alignParentBottom="true"
android:text="Take Photo"
android:layout_gravity="bottom|right" />
</RelativeLayout>
</RelativeLayout>
EDIT
Try this
Try changing your layout like this,