tableview 懒加载

2018-11-20  本文已影响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;
}
上一篇 下一篇

猜你喜欢

热点阅读