找不到动作条资源图标 [英] Can't find the ActionBar resource icon
问题描述
所有,请原谅我刚开始学习Android的发展,这是我第一次在我的Android应用程序中使用动作条
。首先。
我是继教程添加的ActionBar的资源项目。但IDE提醒我的资源不能被发现。请帮忙审查我的当前设置。谢谢。
All, Forgive me I just began to learn development of Android, It is the first time I used the ActionBar
in my Android application. Firstly.
I was following the tutorial to add the resource of ActionBar to project. But the IDE alert me the resource can't be found. please help to review my current setup. thanks.
我已经下载并upziped所有图标。并复制所有图标下的 RES /绘制
文件夹中。
I had downloaded and upziped all the Icons. and copy all the icons under the res/drawable
folder.
和我下面哪些内容显示了文件夹 RES /菜单
下添加一个名为xml文件 main_activity_actions.xml
。
and I add a xml file named main_activity_actions.xml
under the folder res/menu
which content shows below.
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- Search, should appear as action button -->
<item android:id="@+id/action_search"
android:icon="@drawable/Core_Icons/unstyled/hdpi/ic_action_search"
android:title="@string/action_search"
android:showAsAction="ifRoom" />
<!-- Settings, should always be in the overflow -->
<item android:id="@+id/action_settings"
android:title="@string/action_settings"
android:showAsAction="never" />
</menu>
可能有人请告诉我为什么IDE无法找到图标 ic_action_search.png
?谢谢。
推荐答案
不幸的是,资源文件夹不支持目录层次结构(子文件夹),所以你需要将所有的图标移动到父文件夹(绘制
)。
Unfortunately the resource folders do not support directory hierarchies (sub-folders), so you will need to move all icons to the parent folder (drawable
).
然后像这样引用它:安卓图标=@绘制/ ic_action_search
HTTPS://$c$c.google。 COM / p /安卓/问题/细节?ID = 2018
这篇关于找不到动作条资源图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!