I suppose it depends on what you're doing. I use getTextWidths() to underline some text in an overridden TextView's onDraw() before the call to super.onDraw().
On Sep 3, 6:25 pm, hap 497 <hap...@gmail.com> wrote: > Thank you. But how can i specify a certain TextAppearance before > callingPaint.getTextWidths()? > > On Thu, Sep 3, 2009 at 3:19 PM, greg<sep...@eduneer.com> wrote: > > > Have you read aboutPaint.getTextWidths()? > > > On Sep 3, 5:15 pm, hap 497 <hap...@gmail.com> wrote: > >> Hi, > > >> Is there any api to find out the width of a string when rendered using > >> a certain text appearance? > > >> For example, I want to find out how long is the width if I render a > >> string 'hello world' using "?android:attr/textAppearanceLargeInverse" > >> programatically in Java Code. > > >> Thank you. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---