Git Product home page Git Product logo

Comments (7)

LvJianfeng avatar LvJianfeng commented on August 17, 2024

@GrsisFee 我尝试了下,没有发生你说的问题额。

// Demo
let bannerDemo = LLCycleScrollView.llCycleScrollViewWithFrame(CGRect.init(x: 0, y:180, width: w, height: 200), imageURLPaths: ["s3.jpg","http://www.g-photography.net/file_picture/3/3587/4.jpg"], 
    print("当前点击图片的位置为:\(index)")
})
        
bannerDemo.autoScroll = true
bannerDemo.autoScrollTimeInterval = 5.0
bannerDemo.imageViewContentMode = .scaleToFill
bannerDemo.infiniteLoop = true
bannerDemo.delegate = self
        
bannerDemo.customPageControlTintColor = UIColor.red
bannerDemo.customPageControlStyle = .fill
bannerDemo.pageControlBottom = 14.0
bannerDemo.FillPageControlIndicatorRadius = 3.6
bannerDemo.pageControlLeadingOrTrialingContact = 3
        
scrollView.addSubview(bannerDemo)

DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + .seconds(10)) {
    bannerDemo.imagePaths = imagesURLStrings
}

请确认使用版本,最新版本存在的问题,可截图加DEMO代码哦

from llcyclescrollview.

GrsisFee avatar GrsisFee commented on August 17, 2024

我使用的版本 是 pod 1.5.0
根据我的经历 应该是:首次异步设置 bannerDemo.imagePaths 时不会出问题。下拉刷新后,第二次异步设置 bannerDemo.imagePaths 时。pageControl 显示错乱。

首次上传图片,不知道上传对了没。😶
@LvJianfeng
qq20180827-084057-hd

from llcyclescrollview.

GrsisFee avatar GrsisFee commented on August 17, 2024

同是中天人 这张图片 应该是在 第三张的位置。
@LvJianfeng

from llcyclescrollview.

LvJianfeng avatar LvJianfeng commented on August 17, 2024

@GrsisFee 嗯,我就是按你说的方式跑的,没重现你的问题。

let imagesURLStrings = [
    "s3.jpg",
    "http://www.g-photography.net/file_picture/3/3587/4.jpg",
    "http://img2.zjolcdn.com/pic/0/13/66/56/13665652_914292.jpg",
    "http://c.hiphotos.baidu.com/image/w%3D400/sign=c2318ff84334970a4773112fa5c8d1c0/b7fd5266d0160924c1fae5ccd60735fae7cd340d.jpg",
    "http://img3.redocn.com/tupian/20150806/weimeisheyingtupian_4779232.jpg",
];


let imagesURLStrings2 = [
    "http://img3.redocn.com/tupian/20150806/weimeisheyingtupian_4779232.jpg",
    "http://c.hiphotos.baidu.com/image/w%3D400/sign=c2318ff84334970a4773112fa5c8d1c0/b7fd5266d0160924c1fae5ccd60735fae7cd340d.jpg",
    "http://img2.zjolcdn.com/pic/0/13/66/56/13665652_914292.jpg",
    "http://www.g-photography.net/file_picture/3/3587/4.jpg",
    "s3.jpg",
];

let titles2 = ["1",
              "2",
              "3",
              "4",
              "5"
];

let titles3 = ["1-5",
               "2-4",
               "3-3",
               "4-2",
               "5-1"
];


let bannerDemo = LLCycleScrollView.llCycleScrollViewWithFrame(CGRect.init(x: 0, y:180, width: w, height: 200), imageURLPaths: imagesURLStrings, titles: titles2, didSelectItemAtIndex: { index in
    print("当前点击图片的位置为:\(index)")
})
        
bannerDemo.autoScroll = true
bannerDemo.autoScrollTimeInterval = 1.0
bannerDemo.imageViewContentMode = .scaleToFill
bannerDemo.infiniteLoop = true
bannerDemo.delegate = self
        
bannerDemo.customPageControlTintColor = UIColor.red
bannerDemo.customPageControlStyle = .fill
bannerDemo.pageControlBottom = 14.0
bannerDemo.FillPageControlIndicatorRadius = 3.6
bannerDemo.pageControlLeadingOrTrialingContact = 3
        
scrollView.addSubview(bannerDemo)

DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + .seconds(10)) {
    bannerDemo.imagePaths = imagesURLStrings2
    bannerDemo.titles = titles3
}

你可以把这个代码复制到Demo中的viewcontroller跑一下~😁

from llcyclescrollview.

GrsisFee avatar GrsisFee commented on August 17, 2024

对了 我用的 xib 的方式。这有影响么?

from llcyclescrollview.

GrsisFee avatar GrsisFee commented on August 17, 2024

感谢哈,我已经解决了。是在 tableView cell 重用时。会多次赋值 imagePaths, 赋值 imagePaths (我看源码 赋值 该属性时 会致使 pageController 重建),所以 pageController 就显示错乱了

from llcyclescrollview.

LvJianfeng avatar LvJianfeng commented on August 17, 2024

@GrsisFee 嗯嗯,好的吧。这种头,一般都是放在header里比较好~👀

from llcyclescrollview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.