我在 TableView 中添加新行并根据其内容调整其大小,但调整大小后,单元格内容(例如按钮和 didSelectRowAtIndexPath:
)不会被调用。
这是调整大小的代码:
CGRect frame = cell.replayTableView.frame;
int height = (model.replyComments.count*61)+3;
frame.size = CGSizeMake(cell.replayTableView.frame.size.width, height);
cell.tableviewReplay.refTable.frame=frame;
最佳答案
在 heightForRowAtIndexPath 上分配高度
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.Row == 1)
return 50.0;
else if (indexPath.Row == 2)
return 60;
}
关于ios - UITableView 单元格在调整大小后不响应输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32837238/