The drawable's draw() method takes a canvas, so there is no problem having a
drawable use that to draw text.

Also you should almost always implement View.onDraw(), not View.draw().

On Wed, Apr 1, 2009 at 5:23 PM, <[email protected]> wrote:

>
> You will need to extend the View you are displaying the drawable and
> override the draw method to add your custom text like this:
>
> @Override
>        public void draw(Canvas canvas) {
>                super.draw(canvas);
>                canvas.drawText("Title", x,
>                                y, titlePaint);
>         }
>
> On Apr 1, 3:11 am, Erik H <[email protected]> wrote:
> > Hi,
> >
> > I need help to add text in a custom drawable. I'm looking in tha API
> > (android.graphics...) but cannot find any way of doing this.
> >
> > What I basically want is a drawable that contains text that I can
> > change. Is this even possible today?
> >
> > It must be a drawable as I use it where a drawable is required.
> >
> > Thanks!
> >
> > // Erik
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~
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