Question

I have created a custom ActionBar style, and when it is in portrait it looks as intended. For some reason though, when you rotate the screen to landscape the style is not applied and everything on the style bar is applied to a bright white composition. I can not figure out why it is doing this. There are no orientation differences and I have poked around in the documentation as well as Stack Over Flow in order to find something, but honestly I can't find much. This is what my custom code looks like for my Action Bar and it works great in portrait.

    <style name="Theme.Custom" parent="android:style/Theme.Holo.Light">
        <item name="android:actionBarStyle">@style/ActionBar</item>
        <item name="android:actionMenuTextColor">@color/defaultTextColor</item>
    </style>

    <style name="ActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
        <item name="android:icon">@drawable/icon_trans</item>
        <item name="android:background">@drawable/header</item>
        <item name="android:titleTextStyle">@style/ActionBar.Text</item>
    </style>

    <style name="ActionBar.Text" parent="@android:style/TextAppearance">
        <item name="android:textStyle">bold</item>
        <item name="android:textColor">@color/defaultTextColor</item>
    </style>
Was it helpful?

Solution

The problem was that I was using an XML file to define a gradient for my ActionBar and I did not place the xml file in the "drawable-land". Android will obviously not apply a style that is not there. Copying over the XML worked like a charm. So thank you for those who attempted to help!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top