android - 为什么我不应该使用操作系统提供的菜单图标?

标签 android

我想使用 Android 操作系统提供的一些默认菜单图标。

android menu icons

XML 应该是这样的:

<item android:id="@+id/menu_refresh"
   android:icon="@android:drawable/ic_menu_refresh"
   android:title="@string/menu_refresh" />

但是 documentation说这是不明智的。

Warning: Because these resources can change between platform versions, you should not reference these icons using the Android platform resource IDs (i.e. menu icons under android.R.drawable).

我认为使用默认图标的全部意义在于设计确实从操作系统更改为操作系统。通过使用默认图标,您的应用程序的外观和感觉都适合其运行的操作系统。那么使用默认图标有什么不好呢?似乎使用默认图标会损害应用的外观。

最佳答案

问题是你添加了一个谷歌不保证是静态的依赖项。
这些图标的名称可能会改变,大小可能会改变并与您的应用程序不兼容。
如果您希望图标与当前的 google 图标相同,您可以使用可用的 here

关于android - 为什么我不应该使用操作系统提供的菜单图标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6350480/

相关文章:

java.lang.ClassCastException : android. widget.ScrollView 无法转换为 android.widget.TextView

java - Kotlin : how to Convert String with HTML numbers to String without HTML numbers

android - apk 必须使用与之前版本相同的证书进行签名 [release app with other informations]

java - Android sqlite查询获取值大于某个值的表

android - Firemonkey Mobile 中的从右到左的双向语言

android - 即使 listView 中有元素,listView.SeptEmptyView 也会始终显示

android - 如何在android中以天,小时(24),分钟(60),秒(60)获取两个日期之间的差异

android - 调整宽度为半屏

android - 如何创建基于远程加载的图像大小自动调整大小的 Jetpack Compose 图像?

android - 在Android 4.0 Navigation Bar劫持第一次触摸事件