【发布时间】:2013-10-06 23:52:13
【问题描述】:
理论上很简单。我想更改 toast 的背景颜色(android:minSdkVersion="14" android:targetSdkVersion="18")。我做了什么?我找到了 Theme.Holo.Light 定义,我将其用作自己风格的父级:
接下来我找到了:
<item name="android:toastFrameBackground">
我想修改它的巢:
<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 eclipse 总是显示:
错误:错误:找不到与给定名称匹配的资源:attr 'android:toastFrameBackground'。 styles.xml Android AAPT 问题
我什至将它设置为原始版本(只是从原始主题定义中复制的):
<item name="toastFrameBackground">@android:drawable/toast_frame</item>
希望它应该工作。没办法。
当我单击 ctr+space Eclipse 时,似乎看不到 toastFrameBackground。为什么?我检查了原始主题定义中的其他一些项目,有些似乎是可见的,而另一些则没有。
有什么想法吗?帮忙?
我已经花了 3-4 个小时,什么也没...可能我会保留原来的 toast 背景颜色,因为它似乎不值得战斗,但我更愿意更深入地了解机制。为什么我无权访问该项目,看来我应该有权访问。
【问题讨论】: