【发布时间】:2013-02-22 22:51:28
【问题描述】:
CGRect tempframe = _infoText.frame;
tempframe.size.height = _infoText.contentSize.height;
_infoText.frame = tempframe;
[_infoText sizeToFit];
CGFloat height = _infoText.frame.size.height;
CGFloat start = _infoText.frame.origin.y;
_scrollView.contentSize = CGSizeMake(320, height+start);
这以某种方式为我提供了 _scrollView 的正确大小,但即使 _infoText.frame.size.height 目前是正确的,_infoText (UITextView) 也没有改变。也许之后它会变回原来的大小?我在 -viewDidLoad 之后 0.1 秒完成所有这些代码。
【问题讨论】:
标签: xcode uiscrollview uitextview frame cgrect