From bcd39165850c9c93ebb9b1e3ca2a024816153fe7 Mon Sep 17 00:00:00 2001 From: tepmnthar <> Date: Mon, 6 Nov 2017 16:43:14 +0800 Subject: [PATCH] iPhoneX adaptation --- ZYBannerView/ZYBannerView.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ZYBannerView/ZYBannerView.m b/ZYBannerView/ZYBannerView.m index be91e42..311ec79 100644 --- a/ZYBannerView/ZYBannerView.m +++ b/ZYBannerView/ZYBannerView.m @@ -479,6 +479,9 @@ - (UICollectionView *)collectionView _collectionView.backgroundColor = [UIColor groupTableViewBackgroundColor]; _collectionView.delegate = self; _collectionView.dataSource = self; + if (@available(iOS 11, *)) { + _collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; + } // 注册cell [_collectionView registerClass:[ZYBannerCell class] forCellWithReuseIdentifier:banner_item];