iOS 15 适配 UITableView

519 阅读1分钟

if( @available(iOS 15.0,*)){

        self.tableView.sectionHeaderTopPadding = 0;

    }

    if ( @available(iOS 11.0, *)) {

        self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;

    } else {

        self.automaticallyAdjustsScrollViewInsets = NO;

    }