flutter - 在flutter中将自定义透明度值设置为floatingActionButton
问题描述
floatingActionButton: FloatingActionButton(
onPressed: () {},
child: Icon(Icons.add),
backgroundColor: Colors.blueGrey[800],
),
如何将自定义不透明度/透明度值设置为 floatingActionButton?是否有定义透明度百分比的属性?
解决方案
您可以通过为其颜色添加不透明度来设置浮动按钮的透明度
floatingActionButton: FloatingActionButton(
onPressed: () {},
child: Icon(Icons.add),
backgroundColor: Colors.blueGrey.withOpacity(0.5),
),
推荐阅读
- python - 使用 python 和 yahoo Finance(等等)我如何在 X 天的交易日内获取资产价格的数据
- r - 通过data.table roll='nearest'函数合并两组数据
- python - PyGObject 无论如何都会修复按钮大小。相应地打破标签
- web-services - 通知微服务
- javascript - React Native Fetch 给出错误“网络请求失败”
- python - 如何导入具有所需结构的 .txt 文件
- php - 如何获取json数据?
- php - 使用 RabbitMQ 存储数据的正确方法?
- database - Memory consumption in Apache Ignite - BinaryObject vs concrete class vs SQL
- django - 来自 (https://docs.djangoproject.com/en/2.1/intro/tutorial03/) 的 django 项目 3