我尝试将 UITextView(在 tableViewCell 内)调整为内容大小。但它根本不会改变它的高度。我什至改变了 UITableViewCell 的高度。有什么问题?
- (void) setTextViewContents: (NSString*) string
{
[textView setText:string];
CGRect frame2 = self.frame;
frame2.size.height = 10000;
self.frame = frame2;
/* resize the view */
CGRect frame = textView.frame;
frame.size.height = textView.contentSize.height+60;
textView.frame = frame;
该字符串确实出现在视图上,但大小没有改变。