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
  • 7,771
  • 9
  • 35
  • 54
beginner
  • 1,958
  • 4
  • 38
  • 64

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
  • 419
  • 5
  • 18