I want to know if there is any way to determine the width and height of a string depending on the font name and font size used?
Thanks in advance!
Have a look at the sizeWithFont:
method. That should be helpful. Depending on what your exact needs are, you can choose any one of the sister methods too.
You can use
– sizeWithFont:
– sizeWithFont:forWidth:lineBreakMode:
– sizeWithFont:constrainedToSize:
– sizeWithFont:constrainedToSize:lineBreakMode:
– sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode:
Take a look at here
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.