美文网首页
tableview 懒加载

tableview 懒加载

作者: 全世界妳最美 | 来源:发表于2018-11-20 16:23 被阅读7次
- (UITableView *)tableV{
    if (!_tableV) {
        _tableV = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, ScreenW, ScreenH-RectNavAndStatusHight) style:(UITableViewStylePlain)];
        if (@available(iOS 11.0, *)) {// 适配iOS 11
            self.tableV.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
        } else {
            self.automaticallyAdjustsScrollViewInsets = NO;
        }
        _tableV.delegate = self;
        _tableV.dataSource = self;
        _tableV.backgroundColor = QkColor;
        _tableV.showsVerticalScrollIndicator = NO;
        _tableV.showsHorizontalScrollIndicator = NO;
        _tableV.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tableV.estimatedRowHeight = 0;
        _tableV.estimatedSectionFooterHeight = 0;
        _tableV.estimatedSectionHeaderHeight = 0;
        _tableV.pagingEnabled = YES;
        [self.view addSubview:self.tableV];
    }
    return _tableV;
}

相关文章

网友评论

      本文标题:tableview 懒加载

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