首页 > 其他 > 详细

关于UITableViewAutomaticDimension的产生的bug

时间:2019-09-20 14:26:47      阅读:207      评论:0      收藏:0      [点我收藏+]
 

 

一、下面这句代码要想有作用 在iOS11之前需要适配,两个代理都需要实现

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return UITableViewAutomaticDimension;
}
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForHeaderInSection:(NSInteger)section{
    return 60;
}

 

二、今天又发现heightForRow代理方法也不起作用,猜测跟上面是一个意思,试了一下果然

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return UITableViewAutomaticDimension;
}
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 60;
}

 

关于UITableViewAutomaticDimension的产生的bug

原文:https://www.cnblogs.com/chglog/p/11556196.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!