美文网首页
iOS tableView铺满屏幕

iOS tableView铺满屏幕

作者: fordG | 来源:发表于2020-04-27 12:39 被阅读0次

需求铺满全屏幕

image.png
  • 有storyBoard的情况
if #available(iOS 11.0, *){
            UIScrollView.appearance().contentInsetAdjustmentBehavior = .never;
        }else{
            UIScrollView.appearance().automaticallyAdjustsScrollIndicatorInsets = false;
        }

override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        table.frame = view.bounds
    }
  • 纯代码
if #available(iOS 11.0, *){
            UIScrollView.appearance().contentInsetAdjustmentBehavior = .never;
        }else{
            UIScrollView.appearance().automaticallyAdjustsScrollIndicatorInsets = false;
        }

相关文章

网友评论

      本文标题:iOS tableView铺满屏幕

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