Gopika Perumalla
Gopika Perumalla

Reputation: 109

Layout is going below the status bar and here is the code i used for layout

enter image description here

I am facing an issue in my application, I have to set the image taken from camera as background in the canvas. Am calling default camera to take the pic. After taking the pic, a preview is shown of the image taken and will ask us to save or not, If save and home are pressed at the same time, we will go to the home screen. After this I am launching my application from the applications. When opened, the layout where canvas & buttons are placed is going above the status bar.

Edited:

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/layout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/background"
    android:src="@drawable/dbg_bg" >

    <RelativeLayout
        android:id="@+id/dd_layout"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <RelativeLayout
            android:id="@+id/header"
            android:layout_width="310dip"
            android:layout_height="35dip"
            android:layout_alignParentTop="true" >



            <ImageButton
                android:id="@+id/tools"
                android:layout_width="25dip"
                android:layout_height="21dip"
                android:layout_alignParentLeft="true"
                android:layout_marginLeft="15dip"
                android:layout_marginTop="8dip"
                android:background="@drawable/ic_launcher"
                android:tag="3"
                 />


        </RelativeLayout>

        <View
            android:id="@+id/border"
            android:layout_width="fill_parent"
            android:layout_height="2dip"
            android:layout_below="@id/header"
            android:background="@drawable/border" />

        <RelativeLayout
            android:id="@+id/footer"
            android:layout_width="fill_parent"
            android:layout_height="35dip"
            android:layout_alignParentBottom="true" >

            <ImageButton
                android:id="@+id/imgbtn"
                android:layout_width="21dip"
                android:layout_height="21dip"
                android:layout_alignParentLeft="true"
                android:layout_marginLeft="10dip"
                android:layout_marginRight="5dip"
                android:layout_marginTop="8dip"
                android:background="@drawable/ic_launcher"
                android:tag="1"
                android:visibility="invisible" />

            <ImageButton
                android:id="@+id/pt_imgbtn"
                android:layout_width="24dip"
                android:layout_height="19dip"
                android:layout_alignParentRight="true"
                android:layout_marginLeft="2dip"
                android:layout_marginRight="15dip"
                android:layout_marginTop="8dip"
                android:background="@drawable/ic_launcher"
                android:tag="4"
                android:visibility="invisible" />
        </RelativeLayout>

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_above="@id/footer"
            android:layout_below="@id/border" >

            <com.xyz.ddd.canvas.SurfaceCanvas
                android:id="@+id/surfacecanvas"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent" />
        </RelativeLayout>

        <View
            android:id="@+id/footerborder"
            android:layout_width="fill_parent"
            android:layout_height="2dip"
            android:layout_above="@id/footer"
            android:background="@drawable/ic_launcher" />
    </RelativeLayout>

</RelativeLayout>

Upvotes: 1

Views: 407

Answers (1)

Suraj Bajaj
Suraj Bajaj

Reputation: 6640

Why do you have both src and background in your RelativeLayout?

Remove the one which you don't need.

android:background="@color/background"
android:src="@drawable/dbg_bg"

Hope this helps.

Upvotes: 1

Related Questions