0

Is there a method or do you know a possibility to find out the optimal text size in a text view? I think this could be very usefull if you have a changing text in a text view. This could also solve the Problem, that text on a small Screen is to big and the same text size is to small on a big Screen.

  • See http://stackoverflow.com/questions/5033012/auto-scale-textview-text-to-fit-within-bounds – ridoy Jun 30 '13 at 15:38

1 Answers1

0

A very helpful tool in creating layouts that can fit all screen sizes is the attrs.xml. Like drawable-hdpi, drawable-mdpi, etc., you can customize the size of texts (and whatever attribute you want to customize for different screens) by creating a size-specific values folder.

Android also comes with built-in "recommended sizes". Try typing in

?android:attr/text

ctrl+space to see the list of recommended sizes for some of the most common elements that has text in it.

For TextViews you can also modify its style (not textStyle) and use some built-in values such as

@android:style/TextAppearance.Medium
josephus
  • 8,284
  • 1
  • 37
  • 57