I'm trying to implement simple view overlay using RelativeLayout but it seems like something is wrong, I want the last view in the layout to be rendered on top of the rest but it is actually rendered behind. can you spot whats wrong in my code?
edit: figured out it only happens if I want to overlay buttons with some other view
here is the view xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MyActivity">
<Button
android:layout_alignParentTop="true"
android:id="@+id/btn1"
android:text="Normal View"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<FrameLayout
android:background="#ff0000"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>