flutter - 如何在 GridView 中禁用滚动?
问题描述
我有一个 GridView,其父级是ListView
. 如何禁用滚动GridView
以便用户可以滚动 ListView?即使内容已完全呈现,我也无法在 GridView 中找到任何属性来禁用滚动。
解决方案
我认为您可以通过如下设置主要属性来禁用它:
GridView.count(
shrinkWrap: true,
primary: true,
children: <Widget>[],
// ...
)
或者,如果您想完全禁用它:
hysics: new NeverScrollableScrollPhysics()
推荐阅读
- fortran - 分配具有单一形状的多个数组
- python-3.x - 在 python 3 中使用 urllib 抓取图像时出现 HTTP 错误
- scala - Spark 根据第一个数据集中的值更新第二个数据集中的值
- elasticsearch - Kafka Connect 在 30 万条记录后停止
- swift - 等待两个不同的 REST/网络调用完成
- r - 尝试执行逐步前向回归,但出现错误?
- java - Spring Batch 使用不同的 EntityManagerFactories 导致 org.hibernate.StaleObjectStateException
- azure-service-fabric - 连接到本地 Service Fabric 群集
- python - 以 PEP8 方式检查 pandas 重复项
- r - R:如何从字符串向量到引号/名称向量?