Skip to content
New issue

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

关于FamiliarDefaultItemDecoration #28

Open
guowenz opened this issue Jul 4, 2019 · 0 comments
Open

关于FamiliarDefaultItemDecoration #28

guowenz opened this issue Jul 4, 2019 · 0 comments

Comments

@guowenz
Copy link

guowenz commented Jul 4, 2019

我看了下源码,会设置一个默认的mFamiliarDefaultItemDecoration,我看了下getItemOffsets方法,方法最后面有这么一段
int topOrLeftSize;
if ((!isHeaderDividersEnabled || headersCount == 0) && position - headersCount == 0) {
topOrLeftSize = 0;
} else {
topOrLeftSize = mOrientation == OrientationHelper.VERTICAL ? mHorizontalDividerDrawableHeight : mVerticalDividerDrawableHeight;
}

if (mOrientation == OrientationHelper.HORIZONTAL) {
outRect.set(topOrLeftSize, mItemViewBothSidesMargin, 0, mItemViewBothSidesMargin);
} else {
outRect.set(mItemViewBothSidesMargin, topOrLeftSize, mItemViewBothSidesMargin, 0);
}

我的case是在这里面走了else的分支,导致出现了1像素的偏移,被设计师发现了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant