Gaurav Mandlik
Gaurav Mandlik

Reputation: 578

How can i create layout like Overlay images on one another

i want to create a layout to displaying image to overlay one on other like..enter image description here

what i am trying to create like this type of layout in my layout.

<RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="150dp">


            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true">

                <RelativeLayout
                    android:layout_width="130dp"
                    android:layout_height="130dp"
                    android:background="@drawable/round_blue"></RelativeLayout>

                <RelativeLayout
                    android:layout_width="130dp"
                    android:layout_height="130dp"
                    android:layout_marginLeft="60dp"
                    android:background="@drawable/round_yellow"></RelativeLayout>


            </RelativeLayout>


        </RelativeLayout>

my diff circle layout is create by drawable but it will not work, it will create same like that, so any one can help me.

Thanks

Upvotes: 0

Views: 46

Answers (1)

Arun Shankar
Arun Shankar

Reputation: 622

You could try one like this

<RelativeLayout
        android:layout_width="200dp"
        android:layout_height="150dp"
        android:layout_centerInParent="true">

        <RelativeLayout
            android:layout_width="120dp"
            android:layout_height="match_parent"
            android:layout_alignParentLeft="true"
            android:background="#aaff0000"></RelativeLayout>

        <RelativeLayout
            android:layout_width="120dp"
            android:layout_height="match_parent"
            android:layout_alignParentRight="true"
            android:background="#aa00ff00"></RelativeLayout>

    </RelativeLayout>

Upvotes: 2

Related Questions