flutter - Flutter:忽略图标的空间
问题描述
我试图在我的应用程序的左上角或右上角创建一个设置图标。我通过资产图像为设置添加了图标,但我知道我的完整应用程序已向下移动以为图标腾出空间。
我很陌生,所以我不知道如何让我的应用程序的其余部分忽略图标。
感谢帮助!
解决方案
也许您正在使用 IconButton,它具有默认填充,
尝试使用InkWell
InkWell(
child: Icon(Icons.setting)
)
或使用堆栈
Stack(
children: [
*** your body ***
IconButton(icon: Icon(Icons.settings), onPressed: () {})
]
)
推荐阅读
- c++ - 将图像从 c++ 更新到 QML
- java - 蛇头与蛇体 Java 碰撞的问题(处理中)
- python - adding to nested dictionaries in python
- tensorflow - 在 Keras 的部分神经网络中实现随机前向传递?
- python - ValueError: multiclass-multioutput format is not supported using sklearn roc_auc_score function
- api - Keras 烧瓶 API 没有给我输出
- regex - “.*”和“.*”有什么区别?
- url-rewriting - 使用 Wildfly 独立处理程序重定向我的 url 时如何设置占位符?
- android - android模拟器挂在Mac上
- java - 字段列表中的 Spring Boot JPA 未知列