如何预览 R.drawable.* 图像
Android 框架具有各种图标和图像 - 可通过 R.drawable.* 访问 - 应用程序可以使用它们来执行常见任务。它们的名字暗示了它们是什么,但在许多情况下这还不够。人们必须通过反复试验来找到适合自己目的的正确图标。
我的问题:有没有一种方法可以让我在一个地方预览所有这些图像,以便我可以快速决定使用哪些图像?
我查看了 android 源代码,但无法找到这些可绘制对象的根。
如果你们有任何建议,请告诉我。 谢谢。
Android framework has variety of icons and images - accessible as R.drawable.* - that can be used by applications for common tasks. Their names give some hint about what they are, but in many cases that's not sufficient. One has to use trial-n-error to find the right icon that fits one's purpose.
My question: Is there a way where I can preview all these images in one place, so that I can quickly decide which ones to use?
I have looked inside android source code, but couldn't locate the root of these drawables.
Let me know if any of you have any tips.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
谢谢科里,这正是我一直在寻找的。与此同时,我编写了一个小应用程序来预览所有可绘制对象。这是一个小型应用程序,它使用反射来列出所有可绘制对象(图像预览及其名称),如此屏幕截图所示。
它基本上是以下代码片段:
您还可以从 http://www.altcanvas.com/downloads/drawablepreview.tar.gz
或来自 http://www.altcanvas.com/downloads/apks/drawablepreview.apk< 的 apk /a>
Thanks Corey, that's pretty much what I was looking for. Meanwhile though, I cooked a small app to preview all the drawables. It's a small app which uses reflection to list all the drawables (image preview and their names) as shown in this screen shot.
It's basically following code snippet:
You can also get a source tarball from http://www.altcanvas.com/downloads/drawablepreview.tar.gz
or apk from http://www.altcanvas.com/downloads/apks/drawablepreview.apk
android-sdk-root/platforms/android-X/data/res/drawable-hdpi
android-sdk-root/platforms/android-X/data/res/drawable-hdpi
我在 Android 1.5 Drawables 找到了一个有用的链接,该链接指向 Google 的官方 图标设计指南。它似乎包含大多数(如果不是全部)Android 的内置绘图。
I have found a useful link at Android 1.5 Drawables which led to Google's official Icon Design Guidelines. It seems to contain most, if not all, of Android's built-in drawables.
您可以预览Android SDK目录中的所有系统图标。
在 Mac 上查找 Android SDK 目录:
Android Studio.app
。Android Studio
>首选项
sdk
:外观和外观行为
>系统设置
>Android SDK
Android SDK Location
:~/Library/Android/sdk系统图标目录:
使用
Finder.app
访问目录,将项目显示为图标,然后您可以预览所有系统图标。您还可以按图标名称搜索,例如搜索包含
ic_menu_
的图标:或在 Google 字体/图标(并非全部)中预览。
You can preview all system icons in the Android SDK directory.
Finding Android SDK directory on Mac:
Android Studio.app
.Android Studio
>Preferences
sdk
:Appearance & Behavior
>System Settings
>Android SDK
Android SDK Location
: ~/Library/Android/sdkSystem icons directory:
Use
Finder.app
to access the directory, show the items as icons, and then you can preview all system icons.You can also search by icon name, such as searching for icons containing
ic_menu_
:Or preview in Google Fonts / Icons (Not all).