tags:

views:

71

answers:

2

I have a custom-made view that extends the View class. I would like 2 instances of my custom view layered directly on top of each other. How should my layout file look to achieve this?

+2  A: 

Use a RelativeLayout. Later children of the RelativeLayout will overlap earlier children.

CommonsWare
A: 

Turns out FrameLayout was what I wanted. Just do this in your layout:

    <FrameLayout  
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" >

        <com.proj.MyView
            android:id="@+id/board1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"/>

        <com.proj.MyView
            android:id="@+id/board2"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" />

    </FrameLayout>
Finer Recliner