美文网首页
iOS_新版iOS11 UITbleView适配的一些问题及解决

iOS_新版iOS11 UITbleView适配的一些问题及解决

作者: 蔚尼 | 来源:发表于2019-03-20 11:37 被阅读0次
    // tableView 偏移20/64适配
    if (@available(iOS 11.0, *)) {
        self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;//UIScrollView也适用
    }else {
        self.automaticallyAdjustsScrollViewInsets = NO;
    }
     
     
    // tableView 如果是Gruop类型的话,section之间的间距变宽,执行返回高度的同时还需要执行return UIView的代理
    - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
        return 10;
    }
    - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
        return 0.1;
    }
    - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
        return [[UIView alloc] init];
    }
    - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
        return [[UIView alloc] init];
    }
    

    来源:https://www.cnblogs.com/niit-soft-518/p/7879347.html

    相关文章

      网友评论

          本文标题:iOS_新版iOS11 UITbleView适配的一些问题及解决

          本文链接:https://www.haomeiwen.com/subject/jjkzmqtx.html