is there a way to find out what textsize to select to display a number of lines in a label?
for instance I have a label that is 60 height and I want to display 3 lines in it. How to calculate the right textsize? Or label.height is 120 and I want to display a maximum of 5 lines.
Also is there a way to calculate the needed space for a textline?
I want to fit my text on all devices regardless of the activity size.
You can use Canvas.MeasureStringWidth / MeasureStringHeight to measure the size of a given text (not including the gaps between lines).
You will need to first initialize the Canvas. You can initialize it by passing a view or by first creating a mutable bitmap.