简体   繁体   English

如何在 CustomScrollView 中控制 CustomScrollView?

[英]How to control CustomScrollView inside CustomScrollView?

I have widget tree which contains top-level CustomScrollView with SliverFillRemaining inside.我有小部件树,其中包含内部带有 SliverFillRemaining 的顶级 CustomScrollView。 SliverFillRemaining may contain another CustomScrollView (see picture). SliverFillRemaining 可能包含另一个 CustomScrollView(见图)。

在此处输入图像描述

I want to prevent scrolling of nested CustomScrollView until SliverFillRemaining will fill all viewport (because of top-level CustomScrollView).我想阻止嵌套的 CustomScrollView 滚动,直到 SliverFillRemaining 填充所有视口(因为顶级 CustomScrollView)。 In other words I want expandable TabVeiws with scrollable grid inside.换句话说,我想要内部带有可滚动网格的可扩展 TabVeiws。

As Yann39 noted, NestedScrollView widget solves this issue perfectly.正如 Yann39 所指出的, NestedScrollView 小部件完美地解决了这个问题。 Code sample in class documentation illustrates what to do.类文档中的代码示例说明了要做什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM