Giter Site home page Giter Site logo

当viewpager切换的时候,如果前一个fragment被销毁。再次切换回来的话,正在刷新的箭头会重新出现。 about android-materialrefreshlayout HOT 8 OPEN

android-cjj avatar android-cjj commented on June 20, 2024
当viewpager切换的时候,如果前一个fragment被销毁。再次切换回来的话,正在刷新的箭头会重新出现。

from android-materialrefreshlayout.

Comments (8)

taany6210 avatar taany6210 commented on June 20, 2024

我解决了这个bug,在MaterialHeadView或者MaterialFoodView里面的onAttachedToWindow中,设置circleProgressBar.setVisibility(GONE);
addView(circleProgressBar);
然后在onRefreshing的时候设置circleProgressBar.setVisibility(VISIBLE);
最后刷新完成后在onComlete里面设置隐藏circleProgressBar.setVisibility(GONE);

from android-materialrefreshlayout.

yicone avatar yicone commented on June 20, 2024

与你的情况类似,
我是在 FragmentTabHost中的某个Fragment中使用该组件,
这个Fragment做过些简单的处理,实现了类似ViewPager懒加载的效果,即切换到其他tab(Fragment)再切回来时,保持着切走前的UI状态。

在这种情况下,出现了相同的症状。

from android-materialrefreshlayout.

ZhiqiangHe avatar ZhiqiangHe commented on June 20, 2024

The refresh icon will show when i switch from fragment back.

from android-materialrefreshlayout.

imtianx avatar imtianx commented on June 20, 2024

在TabLayout中的ViewPager里面使用,同样也会出现这个问题,该怎么解决

from android-materialrefreshlayout.

imtianx avatar imtianx commented on June 20, 2024

我遇到的这个问题是没有给ViewPager设置缓存,通过给Viewpager设置setOffscreenPageLimit() 方法后,就不会出现下拉或者上啦的箭头了。

from android-materialrefreshlayout.

hongquan66 avatar hongquan66 commented on June 20, 2024

@imtianx 请问通过给 Viewpager 设置 setOffscreenPageLimit() 是设置 0 吗?除此之外 ViewPager 是否有其他配置?我设置 PageLimit 为 0 还是存在该问题

from android-materialrefreshlayout.

imtianx avatar imtianx commented on June 20, 2024

@hongquan66 抱歉,忘记了,这是很久前的了。你试试,但是这个缓存默认是1,最小也是1噢。

from android-materialrefreshlayout.

hongquan66 avatar hongquan66 commented on June 20, 2024

@imtianx 没事,谢谢啦~ 我想想其他办法

from android-materialrefreshlayout.

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.