TextView supports a background drawable:
<TextView
        android:id="@+id/top_bar"
        android:background="@drawable/header"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:text="foo bar"
        />

A FrameLayout with an ImageView and TextView inside might work as well
if you need some feature of ImageView.

On Nov 18, 9:56 pm, pablitoman <[email protected]> wrote:
> Hi, I'm using Android 1.6.
>
> I'm wondering if there's a simple way to put text on top of an
> ImageView element.
> Specifically, I'd like to have text overlayed on top of a rectangle
> filled with a color gradient.
>
> I have the following in my XML layout:
>
> <ImageView android:id="@+id/top_bar" android:src="@drawable/header"
> android:layout_height="fill_parent" android:layout_width="fill_parent"
> android:text="foo bar" />
>
> but the text specified in android:text doesn't show up in my view.
>
> Any thoughts on how to overlay text on top of an image?
>
> There might be a simpler way to do this, so I'm open to alternative
> suggestions but I haven't been able to find anything via the google.
>
> Thanks!!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to