Subclass from Drawable, implement your drawing, instantiate it, and give it to the view you want to have use it.
On Tue, Apr 28, 2009 at 9:30 AM, guruk <[email protected]> wrote: > > is there a chance to design new drawables dynamicly. > > for example right now i have a calendar, each day does have a color > . now i like that its possible that each day does have a drawable > that includes three bars with different colors. > > that mean i can create many drawables that fit all possible color > combinations, or i create a new drawable on the fly with the colors i > need > > is that possible and how? > > chris > > > On 2 Apr., 03:23, [email protected] wrote: > > You will need to extend the View you are displaying thedrawableand > > override thedrawmethod to add your custom text like this: > > > > @Override > > public voiddraw(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 customdrawable. I'm looking in tha API > > > (android.graphics...) but cannot find any way of doing this. > > > > > What I basically want is adrawablethat contains text that I can > > > change. Is this even possible today? > > > > > It must be adrawableas I use it where adrawableis 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, and so won't reply to such e-mails. 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 -~----------~----~----~----~------~----~------~--~---

