Framelayout
The FrameLayout is a placeholder on screen that you can use to display a single view. Views that you add to a FrameLayout are always anchored to the top left of the layout. Consider the following content in main.xml:android:layout_width=”fill_parent”
android:layout_height=”fill_parent”
xmlns:android=”http://schemas.android.com/apk/res/android”
>
Framelayout
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”This is my lovely dog, Ookii”
android:layout_alignParentTop=”true”
android:layout_alignParentLeft=”true”
/>
android:layout_height=”wrap_content”
android:layout_alignLeft=”@+id/lblComments”
android:layout_below=”@+id/lblComments”
android:layout_centerHorizontal=”true”
>
Framelayout
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
/>
Framelayout
Here, you have a FrameLayout within a RelativeLayout. Within the FrameLayout, you embed an imageView. The UI is shown in Figure.NOTE:-This example assumes that the res/drawable-mdpi folder has an image
named ookii.png.
If you add another view (such as a Button view) within the FrameLayout, the view will overlap the previous view (see Figure)
android:layout_width=”fill_parent”
android:layout_height=”fill_parent”
xmlns:android=”http://schemas.android.com/apk/res/android”
>
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”This is my lovely dog, Ookii”
android:layout_alignParentTop=”true”
android:layout_alignParentLeft=”true”
/>
Framelayout
android:layout_height=”wrap_content”
android:layout_alignLeft=”@+id/lblComments”
android:layout_below=”@+id/lblComments”
android:layout_centerHorizontal=”true”
>
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
/>