在SingleChildScrollView内部的Flutter PageView块垂直滚动

时间:2019-12-19 12:41:53

标签: flutter scroll flutter-pageview

我在垂直滚动SingleChildScrollView内部有一个水平滚动PageView

  Expanded(
            child: SingleChildScrollView(
              scrollDirection: Axis.vertical,
              child: Column(
                children: <Widget>[
                  _buildItemImage(),
                   PageView.builder(
                     dragStartBehavior: widget.dragStartBehavior,
                     key: ValueKey<DateTime>(widget.selectedDate),
                     controller: widget.DiDidayPickerController,
                     physics: NeverScrollableScrollPhysics(),
                     scrollDirection: Axis.horizontal,
                     itemCount: _monthDelta(widget.firstDate, widget.lastDate) + 1,
                     itemBuilder: _buildItems,
                     onPageChanged: _handleMonthPageChanged,
            )...

问题是当我尝试在PageView区域中垂直滚动时,它拦截了滚动事件,并且不允许滚动SingleChildScrollView。如何解决?

enter image description here

0 个答案:

没有答案