Tablayout 点击Indicator抖动

来源:互联网 发布:macbook必备软件 知乎 编辑:程序博客网 时间:2024/04/28 00:08

TabLayout 点击的时候其底部的Indicator会有一个回弹抖动,解决方案

 if (ViewCompat.isLaidOut(mTabLayout)) {            mTabLayout.setupWithViewPager(mViewPager);        } else {            mTabLayout.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {                @Override                public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {                    mTabLayout.setupWithViewPager(mViewPager);                    mTabLayout.removeOnLayoutChangeListener(this);                }            });        }



参考
https://code.google.com/p/android/issues/detail?id=175073

https://code.google.com/p/android/issues/detail?id=180462

0 0
原创粉丝点击