Have researched this to death and just cannot find the answer.
I have an ActionBar using AppCompat. I am supporting up to API v7 (API v8 would do). ActionBar works perfectly from API v11. API < v11 has the problem of removing an icon (and thus a feature) from the ActionBar without supplying an Overflow. The big picture is that I have an App Logo, an App Title, and 3 Icons all squidging into the same ActionBar on a low end phone. Trying to make some room!
I would be happy with 1 of 2 solutions. Either:
- A method of getting an Overflow so that the functionality can be retrieved from a pull down.
- (Preferred) A method of removing the icon and text from ActionBar
Below is my current XML for API 11+:
<resources>
<!--
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/LiteActionBarStyle</item>
<item name="actionBarStyle">@style/LiteActionBarStyle</item>
</style>
<style name="LiteActionBarStyle" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="android:displayOptions"></item>
</style>
</resources>
Specifically:
<item name="android:displayOptions"></item>
This iss the attribute that is unavailable before API v11.
This is where I am so far:
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="actionBarStyle">@style/LiteActionBarStyle</item>
</style>
<style name="LiteActionBarStyle" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse"></style>
</resources>
What is the alternative for APIs prior to v11?
EDIT:
Updated Style with transparency suggestion:
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="actionBarStyle">@style/LiteActionBarStyle</item>
</style>
<style name="LiteActionBarStyle" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="android:icon">@android:color/transparent</item>
</style>
</resources>