小编Mat*_*ans的帖子

颤动中的多向滚动

我来自 Web 开发背景,并且习惯于能够创建一个同时具有 x 和 y 溢出的元素(允许向任何方向滚动)。我正在努力使用 Flutter 实现相同的功能。

查看文档,我找到了 SingleChildScrollView,但它只允许 Axis.horizo​​ntal 或 Axis.vertical,而不是两者。

所以我尝试了以下方法:

return SingleChildScrollView( // horizontal scroll widget
    scrollDirection: Axis.horizontal,
        child: SingleChildScrollView( // vertical scroll widget
            scrollDirection: Axis.vertical,
            child: ...content of the container etc...
        )
    );
Run Code Online (Sandbox Code Playgroud)

这适用于 x 和 y,但它不允许对滚动。

有没有办法实现对角滚动,或者有没有更好的材料小部件,我完全没有?

谢谢

flutter flutter-layout

14
推荐指数
1
解决办法
3537
查看次数

标签 统计

flutter ×1

flutter-layout ×1