flutter - Flutter 中的轮播布局
问题描述
如何使轮播布局视图寻呼机像图像滑块一样自动递增,就像在 android 中我们使用视图寻呼机自动滚动一样。
解决方案
利用
列表视图(来源)
ListView(
// This next line does the trick.
scrollDirection: Axis.horizontal,
children: <Widget>[
Container(
width: 160.0,
color: Colors.red,
),
Container(
width: 160.0,
color: Colors.blue,
),
Container(
width: 160.0,
color: Colors.green,
),
Container(
width: 160.0,
color: Colors.yellow,
),
Container(
width: 160.0,
color: Colors.orange,
),
],
)
推荐阅读
- r - 将分面换行顺序从尾随更改为前导空面板
- javascript - 切换侧栏时更改主要内容的宽度
- python - 我如何弄清楚这段代码在做什么?
- knockout.js - Knockout Sortable 阻止点击输入
- magento - 以编程方式向 Magento 2.3.3 中的产品添加自定义属性
- multithreading - 拆分文件以利用多线程、大量读/写操作
- javascript - 使用 uniqid 生成两次唯一 ID
- python - pipenv OSError: [Errno 30] 只读文件系统
- azure - Azure 中托管的应用服务有时会返回 502 错误
- python - 不同的括号类型python