diff --git a/SDCycleScrollView/Lib/SDCycleScrollView/SDCycleScrollView.m b/SDCycleScrollView/Lib/SDCycleScrollView/SDCycleScrollView.m index 68741e88..2ce019b9 100644 --- a/SDCycleScrollView/Lib/SDCycleScrollView/SDCycleScrollView.m +++ b/SDCycleScrollView/Lib/SDCycleScrollView/SDCycleScrollView.m @@ -510,6 +510,13 @@ - (void)layoutSubviews size = [pageControl sizeForNumberOfPages:self.imagePathsGroup.count]; } else { size = CGSizeMake(self.imagePathsGroup.count * self.pageControlDotSize.width * 1.5, self.pageControlDotSize.height); + // ios14 需要按照系统规则适配pageControl size + if (@available(iOS 14.0, *)) { + if ([self.pageControl isKindOfClass:[UIPageControl class]]) { + UIPageControl *pageControl = (UIPageControl *)_pageControl; + size.width = [pageControl sizeForNumberOfPages:self.imagePathsGroup.count].width; + } + } } CGFloat x = (self.sd_width - size.width) * 0.5; if (self.pageControlAliment == SDCycleScrollViewPageContolAlimentRight) {