FrameLayout in Android

A FrameLayout positions its children on top of each other. By adjusting the margin and padding of a view, it is possible to lay out the view below another view.

Example of FrameLayout

<FrameLayout

xmlns:android=“http://schemas.android.com/apk/res/android”

xmlns:tools=“http://schemas.android.com/tools”

android:orientation=“horizontal”

android:layout_width=“match_parent”

android:layout_height=“match_parent”>

<Button android:text=“Button1”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_marginTop=“100dp”

android:layout_marginLeft=“100dp” />

<ImageButton

android:src=”@android:drawable/btn_star_big_on”

android:alpha=“0.35”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_marginTop=“90dp”

android:layout_marginLeft=“90dp” />

</FrameLayout>

 

Leave a Reply

Your email address will not be published. Required fields are marked *