Reputation: 657
<item name="android:actionBarStyle"> @ style / ActionBar.Home </ item>
<item name="actionBarStyle"> @ style / ActionBar.Home </ item>
My Question: Prefix "android:" What is the difference with no prefix "android:"?
<style name="Theme.Iosched" parent="Theme.Base">
<item name="android:windowBackground">@android:color/white</item>
<item name="android:windowContentOverlay">@drawable/actionbar_shadow</item>
<item name="windowContentOverlay">@drawable/actionbar_shadow</item>
<item name="android:actionBarStyle">@style/ActionBar</item>
<item name="actionBarStyle">@style/ActionBar</item>
<item name="android:actionBarTabStyle">@style/ActionBar.TabView</item>
<item name="actionBarTabStyle">@style/ActionBar.TabView</item>
<item name="android:actionBarTabBarStyle">@style/ActionBar.TabBar</item>
<item name="actionBarTabBarStyle">@style/ActionBar.TabBar</item>
<item name="android:actionBarTabTextStyle">@style/ActionBar.TabText</item>
<item name="actionBarTabTextStyle">@style/ActionBar.TabText</item>
</style>
Upvotes: 0
Views: 208
Reputation: 13364
I think you are using some support library to provide ActionBars in pre-HoneyComb devices i.e. ActionBarSherlock.
If so, then when they say backgroundColor then they are referring a variable of their own and if they prefix it with android: they they are trying to access system values. Since these values (constants) might not be available in the device in which you want to add ActionBar.
if you examine these two lines with the help of your IDE (i.e. by ctrl + click in eclipse),
<item name="android:actionBarStyle"> @ style / ActionBar.Home </ item>
<item name="actionBarStyle"> @ style / ActionBar.Home </ item>
both the values of @ style / ActionBar.Home may be pointing to two different locations. Actually these librabries some times make things worst by assuming that the user will never need to modify it.
Once understood the concept is however simple. ActionBarSherlock provides its own configuration (by using these variables) in devices where native support for ActionBar is not available. However it just bypass wherever Action bars are available from the Android API.
Though I must admit reading and understanding ActionBarSherlock is sometimes real pain in the A$$$.
Upvotes: 0
Reputation: 1365
If you look at the top of your .xml file, it should say:
xmlns:android="http://schemas.android.com/apk/res/android"
It's referencing that namespace when so it knows what it's looking at when you say windowBackground.
There's a relevant previous answer here: What does "xmlns" in XML mean?
Upvotes: 2