user2707175
user2707175

Reputation: 1137

styles toast background - no resource found that matches the given name

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 definition

Next I've found:

<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>

etc.

While for Action Bar it works without problems, for toastFrameBackground eclipse displays always:

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.

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.

Any idea? help?

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.

Upvotes: 2

Views: 2980

Answers (1)

ozbek
ozbek

Reputation: 21183

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.

However, you may want to see https://stackoverflow.com/a/9903465/1893766 for what you are trying to achieve.

Upvotes: 2

Related Questions