所有标准的Android图标资源在哪里? [英] Where are all the standard Android icon resources?

查看:463
本文介绍了所有标准的Android图标资源在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始编写我的第一个Java/Android应用程序,因此请原谅所有n00b问题.

I have just started writing my first ever Java/Android application, so forgive the total n00b question.

如何访问标准操作系统图标,例如搜索图标/菜单图标等?它们不在res/drawable文件夹中,我希望在其中找到它们.它们是否可以作为SDK的一部分使用,还是必须单独下载?

How do you access the the standard operating system icons such as search icon/menu icon etc? They are not in the res/drawable folder where I would expect to find them. Are they available as part of the SDK or must you download them seperately?

编辑

也许您可以进一步帮助我-我遇到以下错误(重复出现):

Maybe you can help me further - I am getting the following error (repeated on):

[2011-09-08 19:59:47 - TweetTab] C:\Users\Dan\workspace\TweetTab\res\menu\options_menu.xml:4: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_menu_search').

但是,图标不为空,xml如下所示:

However, the icon is not empty, the xml looks like this:

<?xml version="1.0" encoding="utf-8"?>

<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/search"
        android:icon="@drawable/ic_menu_search"
        android:title="@string/search"/>
</menu>

我想念什么吗?

已解决

我将android:icon="@drawable/ic_menu_search"更改为android:icon="@android:drawable/ic_menu_search",然后它可以找到图标.

I changed android:icon="@drawable/ic_menu_search" to android:icon="@android:drawable/ic_menu_search" and it could then find the icon.

推荐答案

您可以通过android.R.drawable.*@android:drawable/something在xml中访问它们.

You can acces them via android.R.drawable.* or in xml by @android:drawable/something.

这篇关于所有标准的Android图标资源在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆