android:滚动视图中的 RecyclerView [英] android: RecyclerView inside a ScrollView

查看:25
本文介绍了android:滚动视图中的 RecyclerView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 RecyclerView 包裹在 LinearLayout 中,它按预期完美运行.我可以看到 RecyclerView 中的所有数据都已填充.到目前为止一切顺利.

I have a RecyclerView wrapped in a LinearLayout and it works perfectly as expected. I can see all the data in the RecyclerView as populated. So far so good.

当我将 LinearLayout 包装在 ScrollView 中时,RecyclerView 变为空白.我在 RecyclerView 中看不到任何东西.为什么?如何使这项工作发挥作用.

When I wrap the LinearLayout in a ScrollView, the RecyclerView goes blank. I do not see anything inside RecyclerView. Why? How to make this work.

页面是 ViewPagerIndicator 中的标签之一,因此该标签中的所有内容都需要在 ScrollView 中.

The page is one of the tabs in a ViewPagerIndicator, so everything in that tab needs to be in a ScrollView.

感谢大家的帮助.

推荐答案

为 ScrollView 设置这个属性,

Set this property for the ScrollView,

 android:fillViewport="true"

ScrollView 将自身扩展以填充内容

ScrollView will extend itself to fill the contents

这篇关于android:滚动视图中的 RecyclerView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆