开发者

How to find uiscrollview height from random string?

Given the string is randomly generated, some are shorts and some are long.

short e.g:
description dummy text. 

long e.g:
description dummy text. description dummy text. description dummy text. description dummy text. description dummy text. description dummy text. description dummy text. description dummy text. description dummy text.开发者_如何学Python description dummy text. description dummy text. description dummy text. 

I want to create a uiscrollview, with fix width, lets say: 250px, and the height is depend on how many lines that the given string put into the uiscrollview. How do I calculate the height required?

Please advise :D


Have a look at this page.

– sizeWithFont:forWidth:lineBreakMode:  

You can find the height by this method.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜