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
2010-04-13 14:04:49
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
2010-04-14 00:06:58