Sometime we want
to place a view above another view. For example, a textView on top of
imageView.
We use FrameLayout
to do this.
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/f"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:contentDescription="null"
android:src="@drawable/abc" />
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="70dp"
android:text="Text above image"
android:textColor="#ffffff"
android:textSize="26sp" />
</FrameLayout>
View at bottom
of Framelayout will display on top.
Run to see the
result.
No comments:
Post a Comment