有没有一种简单的方法可以将Material Design icons存储库的所有图标导入到android项目中,而不需要手动操作?
发布于 2019-04-16 18:49:03
我发现这个链接对我很有帮助。
https://dev.materialdesignicons.com/getting-started/android
gradle实现可用
dependencies {
implementation 'net.steamcrafted:materialiconlib:1.1.5'
}
添加gradle依赖后,您可以这样创建菜单项。
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" <!-- important, you'll have to include this to use the custom xml attributes -->
xmlns:tools="http://schemas.android.com/tools" >
<!-- example of a menu item with an icon -->
<item
android:title="Disable Wifi"
app:showAsAction="always"
app:materialIcon="wifi_off" <!-- This sets the icon, HAS AUTOCOMPLETE ;) -->
app:materialIconColor="#FE0000" <!-- Sets the icon color -->
/>
</menu>
https://stackoverflow.com/questions/28684759
复制相似问题