0

我尝试将 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;

该字符串确实出现在视图上,但大小没有改变。

4

1 回答 1

0

尝试调用该-[UIView sizeToFit]方法。

于 2013-01-05T22:26:13.503 回答