I need the width and height of the enclosing bounds of a string with limit on width or on height. Found two method, but they does not exactly what I am looking for.
Paint .measureText()
.getTextBounds()
How can I set a limit, i.e. I do not want the bound's width be bigger than 300px?
In iOS NSString
's boundingRect
method calculate this, or the sizeToFit
.