标准的 Android 菜单图标,例如刷新
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2687027/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Standard Android menu icons, for example refresh
提问by poke
The Android SDK offers the standard menu icons via android.R.drawable.X
. However, some standard icons, such as ic_menu_refresh
(the refresh icon), are missing from android.R
.
Android SDK 通过 提供标准菜单图标android.R.drawable.X
。但是,某些标准图标,例如ic_menu_refresh
(刷新图标),在android.R
.
Is there any way to get the original icons, maybe by extracting them from the applications? I already checked the Android source, but it's a bit too huge to look everywhere for the images.
有没有办法获得原始图标,也许是从应用程序中提取它们?我已经检查了 Android 源代码,但它有点太大了,无法到处寻找图像。
I know the Android Drawableswebsite, but I would like to get the correct hdpi, mdpiand ldpiversion, preferable the original ones.
我知道Android Drawables网站,但我想获得正确的hdpi、mdpi和ldpi版本,最好是原始版本。
采纳答案by poke
Never mind, I found it in the source: base.git/core/res/resand subdirectories.
没关系,我在源代码中找到了它:base.git/core/res/res和子目录。
As others said in the comments, if you have the Android SDK installed it's also on your computer. The path is [SDK]/platforms/android-[VERSION]/data/res
.
正如其他人在评论中所说,如果您安装了 Android SDK,它也在您的计算机上。路径是[SDK]/platforms/android-[VERSION]/data/res
。
回答by DMags
Bear in mind, this is a practice that Google explicitly advisesnot to do:
请记住,这是Google 明确建议不要这样做的做法:
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).
警告:因为这些资源会在不同平台版本之间发生变化,所以您不应使用 Android 平台资源 ID(即 android.R.drawable 下的菜单图标)来引用这些图标。
Rather, you are adviced to make a local copy:
相反,建议您制作本地副本:
If you want to use any icons or other internal drawable resources, you should store a local copy of those icons or drawables in your application resources, then reference the local copy from your application code. In that way, you can maintain control over the appearance of your icons, even if the system's copy changes.
如果您想使用任何图标或其他内部可绘制资源,您应该在您的应用程序资源中存储这些图标或可绘制对象的本地副本,然后从您的应用程序代码中引用本地副本。这样,即使系统的副本发生变化,您也可以保持对图标外观的控制。
回答by Gabriel Llamas
Maybe a bit late. Completing the other answers, you have the hdpi refresh icon in:
可能有点晚了。完成其他答案后,您将获得 hdpi 刷新图标:
"android_sdk"\platforms\"android_api_level"\data\res\drawable-hdpi\ic_menu_refresh.png
“android_sdk”\platforms\“android_api_level”\data\res\drawable-hdpi\ic_menu_refresh.png
回答by António Almeida
After seeing this post I found a useful link:
看到这篇文章后,我找到了一个有用的链接:
http://developer.android.com/design/downloads/index.html
http://developer.android.com/design/downloads/index.html
You can download a lot of sources editable with Fireworks, Illustrator, Photoshop, etc...
And there's also fonts and icon packs.
您可以下载许多可使用 Fireworks、Illustrator、Photoshop 等进行编辑的源代码……
还有字体和图标包。
Here is a stencil example.
这是一个模板示例。
回答by yostane
You can get the icons from the android sdk they are in this folder
您可以从 android sdk 中获取它们在此文件夹中的图标
$android-sdk\platforms\android-xx\data\res
$android-sdk\platforms\android-xx\data\res