We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
场景:MainActivity使用了TabStrip + ViewPager布局。lanchmode=singleTask。从某个子页面回到MainActivity时候,偶发错位。
The text was updated successfully, but these errors were encountered:
楼主这个问题解决了吗,我也遇到这个问题了
Sorry, something went wrong.
it is a bug. you can fix it by adding this line to the PagerSlidingTabStrip.java
加上这行就可以了 currentPositionOffset = 0;//source line number 220
getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
@SuppressWarnings("deprecation") @SuppressLint("NewApi") @Override public void onGlobalLayout() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { getViewTreeObserver().removeGlobalOnLayoutListener(this); } else { getViewTreeObserver().removeOnGlobalLayoutListener(this); } currentPosition = pager.getCurrentItem(); currentPositionOffset = 0;//source line number 220 scrollToChild(currentPosition, 0); }
});
No branches or pull requests
场景:MainActivity使用了TabStrip + ViewPager布局。lanchmode=singleTask。从某个子页面回到MainActivity时候,偶发错位。
The text was updated successfully, but these errors were encountered: