RelativeLayout - positioning a View under a ViewGroup
- by Richard
I have the following structure defined in an xml layout file.
<RelativeLayout android:id="@+id/mainLayout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<FrameLayout android:id="@+id/frame" android:layout_centerInParent="true" android:layout_width="wrap_content" android:layout_height="wrap_content" ></FrameLayout>
<Button android:id="@+id/button" android:layout_below="@id/frame" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</RelativeLayout>
The FrameLayout is positioned correctly in the center of its parent. But the Button isn't getting positioned under it. Instead it's displaying in the top left corner.
Am I doing something incorrectly or is this a bug with RelativeLayout?