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

issue #70

Closed
hanayokana opened this issue Jun 30, 2021 · 3 comments
Closed

issue #70

hanayokana opened this issue Jun 30, 2021 · 3 comments

Comments

@hanayokana
Copy link

我想问一个问题哈。LoadSir我用的时候 setDefaultCallback(SuccessCallback::class.java)//设置默认加载状态页
如果用SuccessCallback的话在调用LoadSir.showLoading()的时候,Progressbar并不能显示出来,请问你是怎么设置的?

@hegaojian
Copy link
Owner

可能是你设置了showLoading的时候,后面LoadSir刚好加载View完成设置了 SuccessCallback

@hegaojian
Copy link
Owner

hegaojian commented Jun 30, 2021

我的demo中因为都是Fragment,而且设置loading时都是在lazyLoadData中调用的,这时候loadSir已经注册完毕了,所以此时调用不会有你说的那种问题
但是在普通的Activity中处理的话,我处理方式是先注册view,然后等待view加载完成后再调用 showLoading等等后续方法

//注册
...
LoadSir.getDefault().register(view)
 view.post {
            initView(savedInstanceState) //设置showLoading 及后续的操作都在这里面
        }

@hanayokana
Copy link
Author

谢谢

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

2 participants