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

设置clipToPadding=false后布局bug #13

Closed
jin123d opened this issue Jan 15, 2022 · 6 comments
Closed

设置clipToPadding=false后布局bug #13

jin123d opened this issue Jan 15, 2022 · 6 comments
Labels

Comments

@jin123d
Copy link

jin123d commented Jan 15, 2022

<androidx.recyclerview.widget.RecyclerView
        android:id="@+id/rv_gift"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clipToPadding="false"
        android:paddingLeft="12dp"
        android:paddingRight="12dp" />

两个分页之间的间距没有把padding计算进去

图中红色箭头黑框为上一页礼物的选中框,结果翻页的时候出现到了第二页。

image

@shenbengit shenbengit pinned this issue Jan 15, 2022
@shenbengit
Copy link
Owner

你这个应该和 #9 一样的情况,我无法复现,如果方便可以将复现代码发到我的邮箱,714081644@qq.com

@shenbengit shenbengit unpinned this issue Jan 15, 2022
@jin123d
Copy link
Author

jin123d commented Jan 15, 2022

你这个应该和 #9 一样的情况,我无法复现,如果方便可以将复现代码发到我的邮箱,714081644@qq.com

@shenbengit 代码已提交
jin123d@3f10a04

@jin123d jin123d changed the title 设置paddingLeft/paddingRight后布局bug 设置clipToPadding=false后布局bug Jan 15, 2022
@shenbengit
Copy link
Owner

这不能算是一个bug,clipToPadding=false 就已经允许子View绘制到父View的padding里面,你可以先使用ItemDecoration来实现代替这个效果,我将在版本去兼容这个问题。

@jin123d
Copy link
Author

jin123d commented Jan 16, 2022

这不能算是一个bug,clipToPadding=false 就已经允许子View绘制到父View的padding里面,你可以先使用ItemDecoration来实现代替这个效果,我将在版本去兼容这个问题。

好的。目前来看直接跳到页面就没这个问题,滑动的时候就有。

@shenbengit
Copy link
Owner

试下v1.1.5。

@jin123d
Copy link
Author

jin123d commented Jan 16, 2022

试下v1.1.5。

效果很OK,谢谢大佬!

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

No branches or pull requests

2 participants