开发者

How to avoid scrolling as well as acquire the whole frame of UITextView in iPhone?

I have a fixed size UITextView whose text keeps varying. I want to display the text in a fashion that user dont need to scroll and still he can see the whole text. Also if the text is very short then, it will acquire the whole TextView to make sure user dont see an empty space.When I say the text keeps varying means the length keeps varying.

So as the si开发者_如何学JAVAze is fix and text is varying I know I need to change the size of font for the text. But how to find such an accurate font which will acquire the whole UITextView and avoid scrolling.

I tried using sizeWithFont but it doesnt work. Any kind of help specially with code is appreciated.

Thanks.


Have you thought of using UILabels, with its automatic font sizing to make the text fit a certain rect?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜