本文介绍了Flutter:是否可以点击PageView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
通过将其封装在GestureDetector上,试图使PageView后面的窗口小部件可点击,但它不起作用。还有其他方法吗?
Trying to make widgets behind a PageView clickable by wrapping it around a GestureDetector but it doesn't work. Is there another way I can do this?
new GestureDetector(
behavior: HitTestBehavior.translucent,
child: new PageView(
controller: _pageController,
children: _buildForegroundPages(),
),
),
推荐答案
尝试使用 IgnorePointer
类:
https://docs.flutter.io/flutter/widgets/IgnorePointer-class.html
这篇关于Flutter:是否可以点击PageView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!