Git Product home page Git Product logo

Comments (7)

Jude95 avatar Jude95 commented on July 17, 2024 1

新版本已解决。

from rollviewpager.

Dawnton avatar Dawnton commented on July 17, 2024

可能是因为在执行notifyDataSetChange()方法时,把viewpager重置了,所以会返回第一页,然后不能向左滑动了.这个问题貌似只能重写setAdapter来解决了

from rollviewpager.

Jude95 avatar Jude95 commented on July 17, 2024

这真是个问题。确实notifyDataSetChange()会重置位置。
只有在第一次ViewPager还没有正式启动的时候我可以将位置无消耗的设置到MAX_INT/2。
然后在notifydatasetchange或者其他任何时候...我再次移动当前位置到MAX_INT/2,ViewPager会计算View位置计算到10多亿会直接ANR。
所以我处理了ANR就导致notifydatasetchange的移动没生效。这是个BUG。而且无解...
现在我的方案是一开始MAX_INT/2,notifydatasetchange的时候只设置到realcount*3..因为一直向左自动播放,所以一般发现不了。。
这样还好吧。。1.3.2已改。

from rollviewpager.

pimian avatar pimian commented on July 17, 2024

我拿到最新的版本之后更新数据还是LoopPagerAdapter的notifydatasetchange报错 The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged! Expected adapter item count: 0 屏掉滚动算法mViewPager.getViewPager().setCurrentItem(start,false);之后就好使了 但是右划到初始位置就不能再滑动了

from rollviewpager.

Jude95 avatar Jude95 commented on July 17, 2024

你试试demo有没有问题?是不是你真的修改了count没有notifyDataSetChanged...

from rollviewpager.

dengluoy avatar dengluoy commented on July 17, 2024

@pimian 同样遇到这个问题。

from rollviewpager.

dengluoy avatar dengluoy commented on July 17, 2024

@pimian 该问题已解决。~问题出在v4包上,你应该v4包的中viewpager和作者的不一样。因为老版本的在调用setAdapter的时候。会将mExpectedAdapterCount = 0 ,之后再给mExpectedAdapterCount赋值之前就调用了作者所重写的registerDataSetObserver方法。 在此方法中调用了setCurrentItem所导致。 你只要将v4包替换到23以上就OK了。

from rollviewpager.

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.