【开源】Material Design Icons for Android
Material Design Icons for Android
- https://github.com/vin89423/material-design-icons-for-android
介绍:
将图标做成字体的形式,直接在项目中使用Material图标,不用自己去加载资源文件,也不用管图标的大小适配。还能能自动根据主题显示不同的图标颜色。运行效果:
![]()
使用说明:
在actionBar或者ToolBar中使用:
MaterialIcon md = new MaterialIcon(this);
menu.add("Account Circle").setIcon( materialIconmd.getMenuDrawable("ic_account_circle") );
在ImageView中使用:
MaterialIcon md = new MaterialIcon(this); ImageView img = (ImageView) view.findViewById(R.id.imgView); img.setImageDrawable( md.getDrawable(context, "ic_3d_rotation") );
在ImageView中使用(静态调用的方式)
ImageView img = (ImageView) view.findViewById(R.id.imgView); img.setImageDrawable( MaterialIcon.getDrawable(context, "ic_3d_rotation") );
posted on 2015-04-22 09:56 wasdchenhao 阅读(446) 评论(0) 收藏 举报

浙公网安备 33010602011771号