Giter Club home page Giter Club logo

Comments (5)

KylinTian avatar KylinTian commented on June 28, 2024 1

compile 'com.github.hackware1993:MagicIndicator:1.5.0'
这个版本,问题还是存在的
onPageSelected()方法循环调用,形成死循环

from magicindicator.

hackware1993 avatar hackware1993 commented on June 28, 2024

不能去掉的,这是为了保证在极端情况下指示器的显示状态正确,比如:你的指示器是可编辑的,显示在A界面,你在B界面编辑了指示器并返回到A界面(你可以想象一下今日头条的频道编辑),此时,原有的PositionData肯定不合法了,如果在合法的PositionData再次生成之前收到了onPageSelect或是onPageScroll回调,这时候去处理就显得没意义。所以我在CommonNavigator.preparePositioinData中去手动调了这三个回调,确保状态正确。同时,如果你当前位于ViewPager的C页,你调用ViewPager.setCurrentItem(C)是不会收到onPageSelected回调的,只会收到onPageScroll(C,0.0f,0),此时我也将这个处理成onPageSelect,也是为了确保状态正确

from magicindicator.

lsp19880926 avatar lsp19880926 commented on June 28, 2024

噢。。这样啊,我这边是在onPageSlect里对文字大小颜色做了改变,导致了 标题会在多次调用的时候闪烁。

from magicindicator.

hackware1993 avatar hackware1993 commented on June 28, 2024

改字体大小确实有问题,主要是内部没保存哪些Item该调用onDeselected,所以每次都循环调用,后面会做个记录,只对需要调用onDeselected的item调用

from magicindicator.

hackware1993 avatar hackware1993 commented on June 28, 2024

@lsp19880926 这个问题已解决,你再试试改变字体大小

from magicindicator.

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.