Question

I am having a activity with splitActionBarWhenNarrow as uioption declared in Manifest file, as a result I am getting the action bar menu items as a footer..

Because of the split I am getting a problem in portrait mode. I had set the theme for the Action bar as below

-<style parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse" name="Widget.Styled.ActionBar">

<item name="backgroundStacked">@drawable/header_bg</item>

<item name="android:titleTextStyle">@style/ProjActionBar.TitleTextStyle</item>

<item name="background">@drawable/header_bg</item>

<item name="android:background">@drawable/header_bg</item>

<item name="backgroundSplit">@drawable/header_bg</item>

<item name="android:backgroundSplit">@drawable/header_bg</item>

</style>

Where header_bg is the drawable image with red background

enter image description here enter image description here

If u see my image you could find my problem as in portrait mode I am getting the action bar in blue color, which I need to make red. The same theme works fine in landscape mode as the action bar is red in color

Note: The action item is my customized action bar created using Actionmode.Callback

Thanks in advance

Was it helpful?

Solution

You need to create a style for ActionMode, here's an example:

<style name="Your.ActionMode" parent="@android:style/Widget.Holo.ActionMode">
    <item name="android:background">your_background</item>
    <item name="android:backgroundSplit">your_split_background</item>
</style>

To apply the theme, create a new item for android:actionModeStyle in your root theme.

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