android - 在 XML 中使用 Material 图标

标签 android material-design

我想使用 Google 提供的新素材图标。我觉得单独下载每个图标有点麻烦。 有没有办法做类似的事情:

<ImageButton
  android:src="@android:Icon.Material.IconName"
  .../>

如果没有,在我的项目中包含多个图标的最简单方法是什么? 干杯。

最佳答案

按照以下步骤启动 Vector Asset Studio:

在 Android Studio 中,打开一个 Android 应用项目。 在“项目”窗口中,选择 Android View 。

Right-click the res folder and select New > Vector Asset.

打开Vector Asset Studio后,可以按如下方式添加素材图标:

选择“ Material 图标”

点击选择

选择 Material 图标

关于android - 在 XML 中使用 Material 图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37433903/

相关文章:

Android Stroke Around 来自 Style 的 Material Button

android - 如何在 MPAndroidChart 库中启用立方线?

android - 在 Google Play 上发布 android 应用程序的屏幕截图大小

android - AsyncTask - extending 和 doInBackground 需要哪些参数?

android - 将 flutter CameraImage 转换为文件

reactjs - 使用路线的 Material UI 菜单

android - 将图标与工具栏图标对齐 - Android Material Design

android - Android HAL 和 Linux 设备驱动程序的 sysfs 接口(interface)

android - 如何更改抽屉导航的 TextView 中图标和文本的颜色?

android - 下图中 'Extended app bar'和 'tabs'的总高度是多少?