Saturday, 28 September 2013

Placing a textview on top of imageview in android

Placing a textview on top of imageview in android

I have a listview, that has a single imageview which is scrollable vertically
I am trying to place a textview on top of Imageview
Both the views must be visible



Is it possible ?
If yes, How to do it programmatically ?
What changes should i need to make ?



list_view_item_for_images.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="@+id/flag"
android:layout_width="fill_parent"
android:layout_height="250dp"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:scaleType="fitXY"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
It gives a output like below

How to do something like below

note :: Dish 1 & 2 are textviews

No comments:

Post a Comment