风格举杯背景 - 没有资源发现指定名称相匹配
在理论上很简单的事情。我想改变敬酒的背景颜色(安卓的minSdkVersion =14机器人:targetSdkVersion =18)。我做了什么?我发现,我父用我自己的风格的Theme.Holo.Light定义:
In theory a simple thing. I would like to change the background color of toast (android:minSdkVersion="14" android:targetSdkVersion="18"). What I did? I've found the Theme.Holo.Light definition which I use as parent for my own style:
Theme.Holo.Light定义
接下来,我发现:
<item name="android:toastFrameBackground">
鸟巢,我想修改:
Nest I wanted to modify it:
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="MyTheme" parent="android:Theme.Holo.Light">
<item name="android:actionBarStyle">@style/MyActionBarStyle</item>
<item name="android:toastFrameBackground">@android:color/holo_blue_light</item>
等。
虽然行动吧它的工作原理没有问题,toastFrameBackground月食总是显示:
While for Action Bar it works without problems, for toastFrameBackground eclipse displays always:
错误:错误:没有资源发现,给定的名称匹配:ATTR'机器人:toastFrameBackground。 styles.xml的Android AAPT问题
error: Error: No resource found that matches the given name: attr 'android:toastFrameBackground'. styles.xml Android AAPT Problem
我甚至将其设置为原始版本(由原来的主题定义抄袭):
I've even set it to the original version (just copied from original theme definition):
<item name="toastFrameBackground">@android:drawable/toast_frame</item>
希望能它应该工作。没办法。
Hoping it should work. No way.
当我点击CTR + Eclipse的空间似乎没有看见toastFrameBackground。为什么?我从原来的主题定义查了一些其他项目,有些似乎是可见的,而其他人没有。
When I click ctr+space Eclipse it seems not to see toastFrameBackground. Why? I've checked some other items from original theme definition and some seems to be visible, while others no.
你知道吗?帮助?
我花了3-4个小时,没有什么......也许我会保持原来的土司背景颜色,因为它似乎是不值得打,但我会preFER了解更深层次的机制。为什么我没有到该项目的访问看来我应该有一个访问。
I've spent 3-4 hours and nothing... Probably I will keep the original toast background color as it seems it's not worth to fight but I would prefer to understand deeper the mechanism. Why I don't have an access to the item it seems I should have an access.
这是因为 toastFrameBackground
没有出口,没有对 public.xml
,这意味着该属性不适用于非平台/第三方应用程序。
That's because toastFrameBackground
is not exported and did not make to public.xml
, which means this attribute is not available for non-platform/third-party applications.
但是,您可能希望看到 http://stackoverflow.com/a/9903465/1893766 了解你正在努力实现的。
However, you may want to see http://stackoverflow.com/a/9903465/1893766 for what you are trying to achieve.