Eclipse 无法识别 Android 提供的可绘制对象?

发布于 01-08 08:42 字数 516 浏览 3 评论 0原文

在我的应用程序中,当用户点击“菜单”物理按钮时,我会弹出一个菜单。一切进展顺利,只是 Eclipse 无法识别 Android.jar 包中内置的可绘制对象之一。如果您仔细观察,就会发现,当您创建 Android 项目时,“ic_menu_refresh”已内置到提供的 Android.jar 中。 我使用以下代码来使用特定图标:

android:icon="@android:drawable/ic_menu_refresh"

Eclipse 给我一个错误,说明以下内容:

error: Error: Resource is not public. (at 'icon' with value '@android:drawable/ic_menu_refresh').   
menu.xml    
/Yeousch/res/layout line 3  
Android AAPT Problem

我可以清楚地看到该资源,但 Eclipse 似乎忽略它。有什么解决办法吗?

In my app, I've got a menu which pops up when the user hits the "Menu" physical button. It's going mighty-fine except for the fact that Eclipse isn't recognizing one of the drawables that is built into the Android.jar package. If you look and see, "ic_menu_refresh" is built into the supplied Android.jar when you create an Android Project.
I'm using the following code to use the particular icon:

android:icon="@android:drawable/ic_menu_refresh"

Eclipse gives me an error stating the following:

error: Error: Resource is not public. (at 'icon' with value '@android:drawable/ic_menu_refresh').   
menu.xml    
/Yeousch/res/layout line 3  
Android AAPT Problem

I can clearly see the resource but Eclipse seems to ignore it. Any solutions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

入画浅相思2025-01-15 08:42:51

编译错误告诉您您想要的资源不是公共的,不适合应用程序使用。
根据 http://developer.android.com/guide/practices/ui_guidelines /icon_design_menu.html#examples9 应用程序应提供自己的这些可绘制资源的副本。

The compile error is informing you the resource you want is not public, not for applications to use.
According to http://developer.android.com/guide/practices/ui_guidelines/icon_design_menu.html#examples9 applications should provide their own copies of these drawable resources.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文