【问题标题】:ListView reaches end then stop scrolling and start scrolling the rest of the page FlutterListView 到达结束然后停止滚动并开始滚动页面的其余部分 Flutter
【发布时间】:2021-03-10 09:50:56
【问题描述】:

我在另一个 ListView 中有一个 ListView,基本上可以在可滚动页面中阅读。

我想插入在到达ListView 末尾时停止滚动的选项。如果用户继续滚动,那么页面的其余部分应该开始滚动。

您知道如何实现吗?我看到有一个physics 属性,但不清楚如何设置它。但我认为这在某种程度上应该是答案......

【问题讨论】:

  • 有一个属性叫primary,设置为true并检查

标签: flutter listview dart


【解决方案1】:

只需将 physics: ClampingScrollPhysics() 设置为子 ListView。它创建滚动物理,防止滚动偏移超出内容的范围。更多关于 ListView 及其物理特性请参考:https://medium.com/flutter-community/flutter-listview-and-scrollphysics-a-detailed-look-7f0912df2754

【讨论】:

    猜你喜欢
    • 2022-01-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-01
    • 2021-07-31
    • 1970-01-01
    • 1970-01-01
    • 2021-01-02
    相关资源
    最近更新 更多