android - 如何使我的底部工作表模式可滚动?
问题描述
我有一个带有这种布局的 BottomSheetDialogeFragment。我想滚动整个片段视图而不是仅滚动网格视图。我尝试使用滚动视图和 NestedScrollView 嵌套 LinearLayout,但在这两种情况下,模式甚至都不会滑到顶部。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical">
<ImageView
android:background="@color/colorPrimary"
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/heart"
android:scaleType="fitXY"
android:adjustViewBounds="true"/>
<GridView
android:id="@+id/gridView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:stretchMode="columnWidth"
android:gravity="center"
android:numColumns="4" />
</LinearLayout>
解决方案
推荐阅读
- reactjs - “状态”已被弃用,有什么问题?
- etherpad - Etherpad:如何更改/替换选定的文本并使该文本成为链接
- python - Python 运行 elif 块,当 if 块为真时
- reactjs - react-chart2:给我无法读取未定义的属性(读取“地图”)
- python - 如何在 Java 中使用 sacremoses?
- javascript - 类型“字符串”上不存在属性“包含”| 布尔值 | 细绳[]'
- java - xxx 无法解析为变量
- javascript - 我应该以哪种格式将图像从 Rust 传递给 JS?
- python - 用于 Tensorflow 2.x 的 MaskRCNN 锚层
- laravel - 如何通过控制器将两个不同模型的值作为 Laravel 8 中的单个返回变量传递到视图文件