I want my layout to display surfaceView that covers all the screen width, also displays a TextView on top of the surfaceView, and another horizontal layout below the SurfaceView.
Below is the snapshot of my Eclipse android GUI designer:
Below is the snapshot of actual GUI on my Galaxy S3 device:
Below is the updated layout xml for this GUI/activity
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayoutForPreview"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- SurfaceView should cover all the screens width -->
<SurfaceView
android:id="@+id/surfaceViewBarcodeScanner"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<!-- TextView should be above SurfaceView -->
<!-- LinearLayout will contain linear toolbar -->
<TextView
android:id="@+id/mytext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/mbackground2"
android:gravity="center_horizontal"
android:padding="20dip"
android:textColor="@color/mytextcolor" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="62dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="@drawable/scanner_bottom" >
</LinearLayout>
</RelativeLayout>
Thanks
I hope that this is what you want. I'm not sure if I understand you correctly, though.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- SurfaceView should cover all the screens width -->
<SurfaceView
android:id="@+id/surfaceViewBarcodeScanner"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<!-- TextView should be above SurfaceView -->
<TextView
android:id="@+id/mytext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/mbackground2"
android:gravity="center_horizontal"
android:padding="20dip"
android:textColor="@color/mytextcolor"/>
<!-- LinearLayout will contain linear toolbar -->
<LinearLayout
android:id="@+id/ScannerBottomToolbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="48dp"
android:layout_marginLeft="77dp"
android:orientation="vertical">
</LinearLayout>
</FrameLayout>