android - RecyclerView 滚动在 NestedScrollView 内不起作用
问题描述
我检查了很多答案,但没有一个解决方案适合我!
我的布局是:
<NestedScrollView>
<LinearLayout>
<OtherLayouts>
<LinearLayout>
<RecyclerView>
<OtherLayouts>
</LinearLayout>
</LinearLayout>
</NestedScrollView>
我的问题是我最初必须将 recyclerView 滚动到特定位置。我试过:recyclerView.setNestedScrollingEnabled(false)
我的 recyclerView 的高度已经设置为 wrap_content
很高兴提供任何其他细节。如果您知道解决方案,请提供帮助!
解决方案
你在 RecyclerView 中使用这条线吗
app:layout_behavior="@string/appbar_scrolling_view_behavior"
将管理其余的事情。
推荐阅读
- javascript - 在既不是 React 函数组件也不是自定义 React Hook 函数的函数中调用 React Hook “useStyles”
- ios - WKWebView 在 cataylst 上没有上下文菜单
- java - 线程“main”java.lang.NoClassDefFoundError中的异常,使用maven-shade-plugin打包
- string - Flutter/Dart:将字符串转换为颜色?
- python - 预测时无法加载模型权重(使用 pytorch)
- javascript - Express + Passport + CORS:允许多个域的会话
- java - 如何在 laravel 中使用 H2 数据库?
- regex - notepad++中的正则表达式标记多行模式并删除所有未标记的行,并保留所有标记的行,包括第一行之后标记的行
- java - 使用 AudioClip 没有声音,但没有发生错误
- javascript - 在下拉菜单的 Span 中显示验证错误