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

单独使用指示器,能提供个方法让外界去驱动指示器进度吗? #263

Open
JC-Sung opened this issue Sep 27, 2024 · 0 comments

Comments

@JC-Sung
Copy link

JC-Sung commented Sep 27, 2024

我使用的是Pageboy这个库,内部是是用UIPageViewController实现的,没有用contentScrollView这个属性去KVO滚动,Pageboy提供了滚动进度回调,源码中只需增加这个即可
//用自己的scrollView来更新进度
open func updateSegmentedViewProgress(progress: CGFloat) {

    if progress > CGFloat(itemDataSource.count - 1) || progress < 0 {
        //超过了边界,不需要处理
        return
    }
    //...后面的逻辑和监听contentOffset里的代码一模一样
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