FrameLayout has the attributes android:foreground
, android:foregroundGravity
and android:measureAllChildren
.
I have tried these attributes, but couldn't make out how they affect the layout's appearance or how they work.
<FrameLayout 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:foreground="@android:color/holo_blue_dark"
android:foregroundGravity="center"
android:measureAllChildren="true"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.framelayoutdemo.MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/btn_dialog" />
</FrameLayout>
I have googled, but couldn't find a help with these attributes. Please provide me a link which I can refer or help me with an example. Thanks
android:foreground
andandroid:foregroundGravity
is perfect, but I didnt get how to useandroid:measureAllChildren :
, or why to use. It will be a great help if you can provide and example for its working. Thanks a lot. – Detumescence