有一个自定义cell,点击里面的按钮,改变这个cell的高度,如何做啊,heightForRowAtIndexPath方法中怎么判断是哪个cell中的按钮被点击了?

解决方案 »

  1.   

    在Button的事件处理函数里面,记录Cell的新高度,然后调用reloadTableViewCells方法;
    它会刷新当前修改的Cell,且在heightForRowAtIndexPath方法,最新的高度
      

  2.   

    button生成的时候加个tag就可以知道了
      

  3.   


    理解错误; 3楼的方法可行;
    或者可以从Button的父类开始寻找,直到发现UITableViewCell;然后通过UITableView的indexPathForCell方法,找到它的具体位置。
      

  4.   

    遍历cell数组 i++ 高度
      

  5.   


    reloadTableViewCells这个是如何调用的?
      

  6.   

    [self.tableView beginUpdates];
    [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPathOfYourCell] withRowAnimation:UITableViewRowAnimationNone];
    [self.tableView endUpdates];