Reputation: 6687
I have an application to show the MapView having both height and width fill_parent. I need to overlay some text on the top part of the Map View. How to do this?. The background of text should be transparent. Also the text has the property of marquee. Is it possible to do this?
Upvotes: 0
Views: 3821
Reputation: 27445
Use a RelativeLayout as the root container of you layout and add the MapView and a TextView to it (below the MapView in the layout xml file). Use the TextView to display the text which should be displayed above the map. Now you can use the attributes starting withlayout_
to place the TextView where you want it.
As far as I know, the marquee effect only works when the TextView is focused and its text value is too long to fit in the whole TextView.
The TextView's background should be transparent by default.
Upvotes: 4
Reputation: 56
Create a RelativeLayout as the container of your Mapview and a TextView
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<MapView .../>
<TextView /> </RelativeLayout>
You can display the TextView where you want with the RelativeLayout child attributes, for example on the textView : layout_alignParentBottom="true"
Upvotes: 1