问题
在flutter
开发中,使用ListView
时出现一种现象:初始加载数据时,偏离顶部一定距离或者说顶部没有对齐,如下所示:

解决方法
设置ListView
属性padding
为0
即可,代码如下:
ListView(
padding: const EdgeInsets.only(top: 0),
)
或
ListView.builder(
padding: const EdgeInsets.only(top: 0),
)
...
在flutter
开发中,使用ListView
时出现一种现象:初始加载数据时,偏离顶部一定距离或者说顶部没有对齐,如下所示:
设置ListView
属性padding
为0
即可,代码如下:
ListView(
padding: const EdgeInsets.only(top: 0),
)
或
ListView.builder(
padding: const EdgeInsets.only(top: 0),
)
...
本文标题:flutter ListView顶部偏移一定距离
本文链接:https://www.haomeiwen.com/subject/jqmtbdtx.html
网友评论