Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to change the overflow icon of the contextual action bar without changing it for the standard action bar?
    primarykey
    data
    text
    <p>My app's theme looks like shown in the following screenshot:</p> <p><img src="https://i.stack.imgur.com/w3ZcU.png" alt="action bar with white overflow icon"></p> <p>As the theme is based on <code>Theme.Holo.Light</code> which contains dark action bar texts and overflow icon, I adjusted the overflow icon using the following style:</p> <pre><code>&lt;style name="ActionBar.Light" parent="android:style/Widget.Holo.ActionBar"&gt; &lt;item name="android:background"&gt;@color/highlight&lt;/item&gt; &lt;item name="android:titleTextStyle"&gt;@style/TextAppearance.ActionBar.Title.Light&lt;/item&gt; &lt;item name="android:subtitleTextStyle"&gt;@style/TextAppearance.ActionBar.Subtitle.Light&lt;/item&gt; &lt;/style&gt; ... &lt;style name="Theme.Light" parent="@android:style/Theme.Holo.Light"&gt; ... &lt;item name="android:actionBarStyle"&gt;@style/ActionBar.Light&lt;/item&gt; &lt;item name="android:actionOverflowButtonStyle"&gt;@android:style/Widget.Holo.ActionButton.Overflow&lt;/item&gt; ... &lt;/style&gt; </code></pre> <p>When one or more list entries are checked I want to show a white contextual action bar, but unfortunately the white overflow icon isn't visible on the white background:</p> <p><img src="https://i.stack.imgur.com/dvXqR.png" alt="contextual action bar with white overflow icon on white background"></p> <p>Any idea on how to change the overflow icon only for the contextual bar -- either via style or programatically?</p> <h1>Final Workaround (February 27 2014)</h1> <p>It seems as there isn't an option to change the overflow icon of the contextual action bar independent from the one of the standard action bar. So I had no other choice but changing the background color of the contextual bar to a dark gray, to make the white overflow button visible:</p> <p><img src="https://i.stack.imgur.com/cc5vd.png" alt="gray contextual action bar"></p> <p>The icons on the right are under my control, so it was easy to change them. The "done" icon on the left and the text (check counter) can easily be changed using theme attributes. Only the thin separator between the "done" icon and the check counter cannot be changed using attributes. They would require a custom layout -- that's why I left it how it is for now.</p> <p>Here's my contextual bar style and the relevant part from the theme:</p> <pre><code>&lt;style name="TextAppearance.ActionBar.Title" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title"&gt; &lt;item name="android:fontFamily"&gt;sans-serif-light&lt;/item&gt; &lt;/style&gt; &lt;style name="TextAppearance.ActionBar.Title.Light"&gt; &lt;item name="android:textColor"&gt;#ffffff&lt;/item&gt; &lt;/style&gt; &lt;style name="ContextualBar.Light" parent="android:style/Widget.Holo.ActionMode"&gt; &lt;item name="android:background"&gt;#666666&lt;/item&gt; &lt;item name="android:titleTextStyle"&gt;@style/TextAppearance.ActionBar.Title.Light&lt;/item&gt; &lt;item name="android:actionMenuTextColor"&gt;#ffffff&lt;/item&gt; &lt;/style&gt; &lt;style name="Theme.Light" parent="@android:style/Theme.Holo.Light"&gt; ... &lt;item name="android:actionBarStyle"&gt;@style/ActionBar.Light&lt;/item&gt; &lt;item name="android:actionModeStyle"&gt;@style/ContextualBar.Light&lt;/item&gt; &lt;item name="android:actionModeCloseDrawable"&gt;@drawable/ic_action_done&lt;/item&gt; &lt;item name="android:actionOverflowButtonStyle"&gt;@android:style/Widget.Holo.ActionButton.Overflow&lt;/item&gt; &lt;item name="android:actionMenuTextColor"&gt;#ffffff&lt;/item&gt; ... &lt;/style&gt; </code></pre> <p><strong>Ads:</strong> You can see the full result in <a href="https://play.google.com/store/apps/details?id=mobi.upod.app" rel="nofollow noreferrer">the final app "uPod"</a> which is available at Google play!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload