美文网首页iOS 开发相关Flutter入坑
[Flutter]解决ListView/GridView作为Co

[Flutter]解决ListView/GridView作为Co

作者: lisjiang | 来源:发表于2018-12-19 00:59 被阅读225次

    如下图,这种写法下可滚动Widget显示一片空白,编译能通过。

    异常写法

    方法一:

    在Column中,再多使用Expanded包裹可滚动Widget,即可正常显示。

    生效写法

    方法二:

    ListView/GridView的shrinkWrap改为true值(默认false)。

    相关文章

      网友评论

        本文标题:[Flutter]解决ListView/GridView作为Co

        本文链接:https://www.haomeiwen.com/subject/gaxdkqtx.html