您的位置:首页 > 产品设计 > UI/UE

How do I size a UITextView to its content? from stack overflow!

2012-07-17 23:59 656 查看
see:http://stackoverflow.com/questions/50467/how-do-i-size-a-uitextview-to-its-content

code:

CGRect frame = _textView.frame;

frame.size.height = _textView.contentSize.height;

_textView.frame = frame;

note this line:

One thing to note is that the correct contentSize is only available after the UITextView has been added to the view with addSubview. Prior to that it is equal to frame.size

@import url(http://www.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐