Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

willDisplay cell: FSPagerViewCell, forItemAt index #353

Open
rgmyyw opened this issue Jun 20, 2022 · 0 comments
Open

willDisplay cell: FSPagerViewCell, forItemAt index #353

rgmyyw opened this issue Jun 20, 2022 · 0 comments

Comments

@rgmyyw
Copy link

rgmyyw commented Jun 20, 2022

pagerView(_:willDisplay:forItemAt:) This function is called 2 time

Expected a index, not two indexes, When the transformer is crossFading

    lazy var pagerView: FSPagerView = {
        let view = FSPagerView(frame: .zero)
        view.dataSource = self
        view.delegate = self
        view.register(ExploreBannerCell.self, forCellWithReuseIdentifier: ExploreBannerCell.defaultReuseIdentifier)
        view.isInfinite = true
        view.bounces = false
        view.automaticSlidingInterval = 3
        view.interitemSpacing = 0
        view.transformer = FSPagerViewTransformer(type: .crossFading)
        view.tg_width.equal(.fill)
        view.tg_height.equal(.fill)
        return view
    }()




    func pagerViewDidEndDecelerating(_ pagerView: FSPagerView) {
        logDebug("\(#function ) index: \(pagerView.currentIndex)")
    }


    func pagerView(_ pagerView: FSPagerView, willDisplay cell: FSPagerViewCell, forItemAt index: Int) {
        logDebug("\(#function ) index: \(index)")
    }

    
    func pagerView(_ pagerView: FSPagerView, didEndDisplaying cell: FSPagerViewCell, forItemAt index: Int) {
        logDebug("\(#function ) index: \(index)")
    }


2022-06-20 16:00:02.910161+0800 MetaRent[41044:7781035] pagerView(_:willDisplay:forItemAt:) index: 2
2022-06-20 16:00:02.911786+0800 MetaRent[41044:7781016] pagerView(_:willDisplay:forItemAt:) index: 3
2022-06-20 16:00:05.909641+0800 MetaRent[41044:7781030] pagerView(_:didEndDisplaying:forItemAt:) index: 0
2022-06-20 16:00:05.910420+0800 MetaRent[41044:7781035] pagerView(_:didEndDisplaying:forItemAt:) index: 4
2022-06-20 16:00:08.909986+0800 MetaRent[41044:7781030] pagerView(_:willDisplay:forItemAt:) index: 4
2022-06-20 16:00:08.910604+0800 MetaRent[41044:7781016] pagerView(_:willDisplay:forItemAt:) index: 0
2022-06-20 16:00:11.910524+0800 MetaRent[41044:7781035] pagerView(_:didEndDisplaying:forItemAt:) index: 1
2022-06-20 16:00:11.911241+0800 MetaRent[41044:7781016] pagerView(_:didEndDisplaying:forItemAt:) index: 2
2022-06-20 16:00:14.912001+0800 MetaRent[41044:7781016] pagerView(_:willDisplay:forItemAt:) index: 1
2022-06-20 16:00:14.913418+0800 MetaRent[41044:7781030] pagerView(_:willDisplay:forItemAt:) index: 2
2022-06-20 16:00:17.910743+0800 MetaRent[41044:7781035] pagerView(_:didEndDisplaying:forItemAt:) index: 3
2022-06-20 16:00:17.911274+0800 MetaRent[41044:7781016] pagerView(_:didEndDisplaying:forItemAt:) index: 4
2022-06-20 16:00:20.894267+0800 MetaRent[41044:7781016] pagerView(_:willDisplay:forItemAt:) index: 3
2022-06-20 16:00:20.894750+0800 MetaRent[41044:7781030] pagerView(_:willDisplay:forItemAt:) index: 4
2022-06-20 16:00:23.894119+0800 MetaRent[41044:7781030] pagerView(_:didEndDisplaying:forItemAt:) index: 0
2022-06-20 16:00:23.894442+0800 MetaRent[41044:7781016] pagerView(_:didEndDisplaying:forItemAt:) index: 1
2022-06-20 16:00:26.897322+0800 MetaRent[41044:7781016] pagerView(_:willDisplay:forItemAt:) index: 0
2022-06-20 16:00:26.898987+0800 MetaRent[41044:7781035] pagerView(_:willDisplay:forItemAt:) index: 1
2022-06-20 16:00:29.896391+0800 MetaRent[41044:7781030] pagerView(_:didEndDisplaying:forItemAt:) index: 2
2022-06-20 16:00:29.896993+0800 MetaRent[41044:7781035] pagerView(_:didEndDisplaying:forItemAt:) index: 3
2022-06-20 16:00:32.897715+0800 MetaRent[41044:7781030] pagerView(_:willDisplay:forItemAt:) index: 2
2022-06-20 16:00:32.899324+0800 MetaRent[41044:7781033] pagerView(_:willDisplay:forItemAt:) index: 3
2022-06-20 16:00:35.896129+0800 MetaRent[41044:7781030] pagerView(_:didEndDisplaying:forItemAt:) index: 4
2022-06-20 16:00:35.896380+0800 MetaRent[41044:7781033] pagerView(_:didEndDisplaying:forItemAt:) index: 0


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant