【发布时间】:2021-11-23 21:45:45
【问题描述】:
我在底部导航中有四个不同的选项卡,其中一个选项卡(最后一个)是 SingleChildScrollView。我希望我可以点击底部导航上的图标,也可以滚动浏览应用程序。效果很好,只有最后一个选项卡会带来很多麻烦:我的问题是,当我向下滚动到 SingleChildScrollView (最后一个选项卡)时,我不能再滚动到它上面的选项卡了。这就是我的 PageView 的样子(它是 Body):
body: PageView(
scrollDirection: Axis.vertical,
onPageChanged: (page) {
setState(
() {
_selectedIndex = page;
},
);
},
controller: _controller,
children: [
Home(),
Games(),
Shop(),
AboutUs(),
],
),
);
}
这就是我的选项卡 (AboutUs()) 的样子:
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
scrollDirection: Axis.vertical,
physics: BouncingScrollPhysics(),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// In there are many many children (Containers, etc. :))
],
),
);
}
对不起,我的解释不好,希望有人能提供帮助!已经谢谢了! :)
【问题讨论】:
标签: flutter dart mobile pageviews singlechildscrollview