flutter组件之Icon
发布日期:2021-10-15 18:54:37 浏览次数:2 分类:技术文章

本文共 1303 字,大约阅读时间需要 4 分钟。

Icon是图标组件。

Row(  mainAxisAlignment: MainAxisAlignment.spaceAround,  children: const 
[ Icon( Icons.favorite, color: Colors.pink, size: 24.0,//图标显示的大小,固定是正方形,默认24, semanticLabel: 'Text to announce in accessibility modes',//提供语言辅助描述,还未用到过 ), Icon( Icons.audiotrack, color: Colors.green,//图标颜色,如果不设置,默认是黑色图标 size: 30.0, textDirection:,//图标显示的方向,是向左还是向右,IconData的matchTextDirection为true时有效,matchTextDirection默认值为false,因此只设置textDirection无效 ), Icon( Icons.beach_access, color: Colors.blue, size: 36.0, ), //IconData()方式的图标 Icon( IconData(0xe914, fontFamily: 'MaterialIcons',matchTextDirection: true), color: Colors.red, size: 30, textDirection: TextDirection.rtl ), //ImageIcon()方式的图标 ImageIcon( AssetImage("images/img06.png"), color: Colors.green, size: 40, ),//绿色 //图标按钮 IconButton( icon: Icon( Icons.accessible, color: Colors.green, ), iconSize: 24.0, padding: const EdgeInsets.all(8.0), alignment: Alignment.center, color: Colors.red, onPressed: () {
},//点击触发的方法 highlightColor: Colors.green,//长按后不松手时显示的颜色 splashColor: Colors.blue,//点击一下时闪烁的颜色 disabledColor: Colors.grey,//不可用时的颜色 tooltip: "sss",//长按后的提示语 ), ],)

转载地址:https://blog.csdn.net/shenshulong/article/details/103910222 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:flutter组件之Placeholde
下一篇:flutter组件之Stack

发表评论

最新留言

很好
[***.229.124.182]2024年04月03日 00时22分47秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章