Git Product home page Git Product logo

Comments (4)

summer-zhoujie avatar summer-zhoujie commented on July 17, 2024

http://www.jb51.net/article/107257.htm
找到原因了。。。如果这是真的原因,那么我华丽的侮辱了自己

from rollviewpager.

Jude95 avatar Jude95 commented on July 17, 2024

POSITION_NONE就是为了刷新。
另外不用担心重复创建View。只有DynamicPagerAdapter LoopPagerAdapter 是返回POSITION_NONE。而这2个都是我自己实现了一套View缓存机制。从新调用instantiateItem不等于重新创建ChildView。

from rollviewpager.

summer-zhoujie avatar summer-zhoujie commented on July 17, 2024

首先感谢您耐心的回答!

default
sss

还有一个疑问是每notify一下,mViewList都会clear一下,导致在instantiateItem里面从新创建,我想将clear的代码注释掉,这样既刷新了界面,又不用从新创建View,这样的思路正确吗

from rollviewpager.

Jude95 avatar Jude95 commented on July 17, 2024

notify...不就是刷新View=重新创建View吗。在原ViewPager和RecycleView里都是这样。不clean旧view...你咋刷新界面。
你如果只是想修改界面,不应该调用notify,直接修改View就好

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.