android - 具有多个 ListView 的嵌套 ScrollView 不滚动
问题描述
我只希望我的嵌套滚动视图滚动,我不希望列表滚动。由于某种原因,滚动视图不滚动。我查看了与嵌套滚动视图、滚动视图和列表视图相关的多个帖子,但没有一个解决方案有帮助。滚动视图不起作用很奇怪,我不确定我是否遗漏了什么。此外,我的列表视图具有动态高度。
这是我的代码:
<android.support.v4.widget.NestedScrollView
android:id="@+id/ns_scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey"
android:orientation="vertical">
<TextView
style="@style/customFontStyleBook"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:padding="5dp"
android:text="Heading 1"
android:textColor="#000"
android:textStyle="bold"/>
<ListView
android:id="@+id/ll1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey"
android:orientation="vertical">
<TextView
style="@style/customFontStyleBook"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:padding="5dp"
android:text="Heading 2"
android:textColor="#000"
android:textStyle="bold"/>
<ListView
android:id="@+id/ll2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey"
android:orientation="vertical">
<TextView
style="@style/customFontStyleBook"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:padding="5dp"
android:text="Heading 3"
android:textStyle="bold"
android:textColor="#000" />
<ListView
android:id="@+id/ll3"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
解决方案
推荐阅读
- c# - 不定期出现此错误“多个同时连接或不同连接的连接~”
- node.js - 子进程在使用 Pacman -U 时从 stderror 打印正常输出
- selenium-webdriver - 在 phptravels.ner/login 页面上验证警报
- python - 如何在 tkinter 下拉列表中放置函数?
- python - 使用 python 的 plotly cloropleth 绘制 GeoJSON 问题
- applescript - Applescript使用预览将文件夹中的所有文件导出为pdf
- algorithm - 是否有一种快速的概率算法来计算用户之间的相互事物的数量?
- nest-device-access - 为 master 项目使用嵌套设备访问控制台
- c# - Azure 函数对象返回未返回正确的嵌套值
- c# - 根据提供的路径重定向到操作不起作用