autostretch uitextview,scrollview和static cells

时间:2013-03-08 02:43:47

标签: xcode uitextview

我有一个包含四个静态单元的uitableview 第一个单元格有uitextview 第二和第三和常规细胞 第四个单元格有uitextview

我需要第一个和第四个单元格根据内容大小增长和缩小。第四个单元格将有更大的文本,因此整页应滚动。

任何想法如何做到这一点?感谢。

d

1 个答案:

答案 0 :(得分:0)

您可以使用:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{

if (indexPath.row == 0) {

    // Your code to find height of the text whic will display in UITextView.

}else{

    // your default cell height
}

}

希望这会对你有所帮助。

一切顺利!!!

相关问题