【问题标题】:Flutter- How can I add Title to SliverList's SliverChildBuilderDelegate?Flutter-如何将标题添加到 SliverList 的 SliverChildBuilderDelegate?
【发布时间】:2022-01-09 13:40:17
【问题描述】:

我想实现类似于下图的设计。我已将 SliverList 与 CustomScrollView 一起使用。现在,如何向 SliverList 添加标题?

有多个水平和垂直滚动视图,因此我使用 CustomScrollView 来优化性能。

【问题讨论】:

    标签: flutter flutter-layout flutter-sliver


    【解决方案1】:

    尝试在 SliverList 之间使用 SliverToBoxAdapter:

    SliverToBoxAdapter(
      child: Text('Covid info'),
    )
    

    【讨论】:

    • 我也有同样的想法。但是根据flutter文档,使用多个SliverToBoxAdapter,效率并不高。你可以看到here
    • 我想你误解了这意味着什么,这意味着不要将“多个 SliverToBoxAdapter”用作“SliverList”。可以作为 SliverList 的标题
    • 知道了。谢谢。
    猜你喜欢
    • 1970-01-01
    • 2018-10-03
    • 1970-01-01
    • 2019-06-20
    • 2021-04-17
    • 2020-08-31
    • 1970-01-01
    • 1970-01-01
    • 2019-03-08
    相关资源
    最近更新 更多