Giter Site home page Giter Site logo

Comments (7)

prohack avatar prohack commented on August 19, 2024 2

你绑定了吗? zhongzixing @.> 于2022年8月26日周五 16:45写道:

setCurrentItem(index, false)光标不移动,另外初始化Viewpager其他index。选中tab也无法准确选中 — Reply to this email directly, view it on GitHub <#290>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFJNWTMJH32PRI2FUR7WGZLV3B73VANCNFSM57V42J4Q . You are receiving this because you are subscribed to this thread.Message ID: @.
>

解决了,如果不需要滑动动画的话,则需要手动在onPageSelected之前进行onPageScrolled(position,0f,0)就可以了

from magicindicator.

zl277287818 avatar zl277287818 commented on August 19, 2024 1

viewPager.setCurrentItem(index,false);
magicIndicator.onPageScrolled(index,0,0);

from magicindicator.

hackw avatar hackw commented on August 19, 2024

from magicindicator.

prohack avatar prohack commented on August 19, 2024

绑定了依然会出现这问题,如果是setCurrentItem(index, true)光标则会正常移动,很头疼

from magicindicator.

prohack avatar prohack commented on August 19, 2024

你绑定了吗? zhongzixing @.> 于2022年8月26日周五 16:45写道:

setCurrentItem(index, false)光标不移动,另外初始化Viewpager其他index。选中tab也无法准确选中 — Reply to this email directly, view it on GitHub <#290>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFJNWTMJH32PRI2FUR7WGZLV3B73VANCNFSM57V42J4Q . You are receiving this because you are subscribed to this thread.Message ID: @.
>

使用的viewpager2,自己手动绑定的,依然会出现这问题,如果是setCurrentItem(index, true)光标则会正常移动,很头疼

from magicindicator.

minorlai avatar minorlai commented on August 19, 2024

绑定了依然会出现这问题,如果是setCurrentItem(index, true)光标则会正常移动,很头疼

一样遇到这问题啊,怎么解决,绑定viewpager点击tab切换fragment,setCurrentItem(index, false),就没有动画,
setCurrentItem(index, true)就正常有动画
@hackw @zhongzixing @prohack @zl277287818

from magicindicator.

minorlai avatar minorlai commented on August 19, 2024

发现demo 的 LoadCustomLayoutExampleActivity 类也是这样:
commonPagerTitleView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mViewPager.setCurrentItem(index, false); } });

.setCurrentItem(index, false); 点击底部菜单就没有动画了 @hackw

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.