之前textView算文字高度总是拿不到合适的高度。在Stack Overflow 找到了解决方法备注在此。
代码如下:
UITextView * textView=[[UITextView alloc] initWithFrame:CGRectMake(20, 40, self.view.frame.size.width-40, 20)];
textView.text=@" I'm porting one of apps from iOS 6.1 to iOS 7. I'm using a layout where there's a UITextView that has a fix width, but it's height is based on its contentsize. For iOS 6.1 checking the contentsize.height and setting it as the textview's frame height was enou