Tag: 可用uviewview

在静态表格视图中dynamic调整文本视图和表格视图单元格的大小

我有一个静态表视图,我正在使用作为我的应用程序的数据inputsot。 其中一个单元格中有一个UITextView,它需要随着用户的input而dynamic增长和缩小,以及逻辑上随着单元格的增长/收缩。 我读了一堆这个post,但我想我正在被抛出,因为我正在使用一个STATIC表视图。 这里是我resize的尝试(它几乎总是失败): – (void)textViewDidChange:(UITextView *)textView { self.numberOfLines = (textView.contentSize.height / textView.font.lineHeight) – 1; float height = 44.0; height += (textView.font.lineHeight * (self.numberOfLines – 1)); CGRect textViewFrame = [textView frame]; textViewFrame.size.height = height – 10.0; //The 10 value is to retrieve the same height padding I inputed earlier when I initialized the UITextView [textView […]