问题
在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),
)
...