1

Is it possible to set TextView's text size to be the same as TextView height, when TextView height isn't predefined(WRAP_CONTENT or FILL_PARENT)?

solution : Auto Scale TextView Text to Fit within Bounds

Community
  • 1
  • 1
amukhachov
  • 5,566
  • 1
  • 37
  • 55

2 Answers2

0

I've found the library that do exactly what I want : SizeAdjustingTextView

amukhachov
  • 5,566
  • 1
  • 37
  • 55
0

i also wanted to do something like this and the closest you can seem to get is to say android:textSize=20dp (or whatever size you think is appropriate) for either your style or each element that is displaying text. since dp is device independent pixels, if it appears to be taking up the whole screen on your device, then it is supposed to appear that way on all other devices too. you might want to check on this as you might have to choose a different dp value for each of the different size/density combinations possible (depending on what kind of devices you are aimed at, also whether you are allowing the use to change the orientation) this has all that info.

dylan murphy
  • 1,360
  • 1
  • 18
  • 33