1

I have a function that generates a random number. Then, I place the number in a TextView. When the number is a single digit, it fills the TextView perfectly, but when the number is two digits or more, it only shows a single digit because the text size is huge.

How do I automatically fit the text size to the TextView? Something like reduce the text size so that all the number will be shown in the TextView.

Alex K
  • 8,269
  • 9
  • 39
  • 57
beginner
  • 2,024
  • 5
  • 43
  • 76

1 Answers1

0

I don't have enough reputation to comment so I must abuse an answer. No need to reduce the number's size. Just make sure the TextView is set to wrap_context in the layout:width property and also possibly the layout:height property, that should fix your formatting problem.

Benyam Ephrem
  • 448
  • 6
  • 20