开发者

Why is the returned height of sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode: always the same?

开发者 https://www.devze.com 2022-12-27 17:58 出处:网络
For some reason, the CGSize which is returned by sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode: is pretty useless. In my case it remains 55 no matter how much the text gets shrinked.

For some reason, the CGSize which is returned by sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode: is pretty useless. In my case it remains 55 no matter how much the text gets shrinked. It's always the same value. It never changes. The only thing that seems to work is the actualFontSize but that doesn't tell me a lot about how heigh the text rectangle is now, does it? (don't know much about typography but I think this 开发者_Go百科pica font size stuff sucks and never works really precise)


I found the same problem with sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode: so came up with a solution for calculating the height based on the actualFontSize.

It is here https://stackoverflow.com/a/13517335/1791042

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号