Monday, November 2, 2009

[android-developers] Max font size of a TextView?

Hi,

I have a textview, I'd like it to use a font size of 14, but if it's
too wide to fit its parent container at that size, then choose a
smaller font size to fit. Looks like this:

<LinearLayout
gravity="center"
width="fill_parent">
<TextView textSize="14" singleLine="true"
</LinearLayout>

Is there a built in way to do this? Or do I have to somehow measure
the text before hand and choose a font size myself?

Thanks

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment