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

与appbarlayout嵌套,事件冲突 解决方案 #1253

Open
zhaobinsir opened this issue Nov 8, 2024 · 2 comments
Open

与appbarlayout嵌套,事件冲突 解决方案 #1253

zhaobinsir opened this issue Nov 8, 2024 · 2 comments

Comments

@zhaobinsir
Copy link

问题描述:当[CoordinatorLayout]嵌套横向banner时,在banner上点住上下滑动会失效。(banner2 本质就是viewpager2)
解决方案:
Banner.viewPager2.children.find { it is RecyclerView }?.let {
(it as RecyclerView).isNestedScrollingEnabled = false
}

问题原因:[ViewPager2]使用RecyclerView实现,RecyclerView吃掉了nested的一系列方法,导致无法回传至CoordinatorLayout,导致behavior失效,最终无法滑动
希望作者采纳!!

@jigongdajiang
Copy link

我的场景是;通过上面的方法后,上下滑动页面依旧不动呢。

@jigongdajiang
Copy link

<com.google.android.material.appbar.AppBarLayout
<com.youth.banner.Banner

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

2 participants