ios11适配

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u013127850/article/details/78662225

1.iOS11下必须加那两个方法,否则不走表头表尾高度设置方法的

-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
    UIView *footView = [[UIView alloc]init];
    return footView;
}
-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView *headerView = [[UIView alloc]init];
    return headerView;
}


2.ios11不走self.automaticallyAdjustsScrollViewInsets = NO;


需要设置:

if (@available(iOS 11.0, *)) {
        tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    } else {
        // Fallback on earlier versions
    } 

猜你喜欢

转载自blog.csdn.net/u013127850/article/details/78662225