UITableViewCell 如何获取自身高度

来源:互联网 发布:it has =it's 编辑:程序博客网 时间:2024/06/05 16:19

实现 heightForRowAtIndexPath 根据判断做相应该的调整。

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

{

   

    NSString *identifier=@"Cell";

    UITableViewCell *cell =(UITableViewCell *)([self.myTableView dequeueReusableCellWithIdentifier:identifier]);

    if([indexPath row] ==0){

        return cell.frame.size.height+50;

    }

    return 44;

    

}


0 0
原创粉丝点击