无故事王国
2023-10-13 941347efd4ed52a048aaf26b909508dd0c49d7ae
WanPai/Common/View/CommonBannerView.swift
@@ -62,6 +62,7 @@
        scrollView.contentOffset = CGPoint(x:width,y:0)
        scrollView.isUserInteractionEnabled = true
        scrollView.isPagingEnabled = true
      scrollView.isScrollEnabled = images.count > 1
        scrollView.showsHorizontalScrollIndicator = false
        scrollView.delegate = self
        self.addSubview(scrollView)
@@ -90,13 +91,18 @@
        scrollView.addSubview(image)
        setImage(image: image, index: 0)
        pageControl.center = CGPoint(x:width/2,y:height - CGFloat(15))
//        pageControl.center = CGPoint(x:width/2,y:height - CGFloat(15))
        pageControl.isEnabled = true
        pageControl.numberOfPages = images.count
        pageControl.currentPageIndicatorTintColor = UIColor.green
        pageControl.pageIndicatorTintColor = UIColor.gray
        pageControl.currentPageIndicatorTintColor = UIColor.white
      pageControl.pageIndicatorTintColor = UIColor.gray.withAlphaComponent(0.5)
        pageControl.isUserInteractionEnabled = false
      pageControl.isHidden = images.count == 1
        self.addSubview(pageControl)
      pageControl.snp.makeConstraints { make in
         make.bottom.equalToSuperview().offset(0)
         make.centerX.equalToSuperview()
      }
            //当前显示的只有 center_image 其他两个只是⽤来增加滑动时效果⽽已,不
            //addTapGesWithImage(image: center_image)