How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -
have researched death , cannot find answer.
i have actionbar using appcompat. supporting api v7 (api v8 do). actionbar works api v11. api < v11 has problem of removing icon (and feature) actionbar without supplying overflow. big picture have app logo, app title, , 3 icons squidging same actionbar on low end phone. trying make room!
i happy 1 of 2 solutions. either:
- a method of getting overflow functionality can retrieved pull down.
- (preferred) method of removing icon , text actionbar
below current xml api 11+:
<resources> <!-- base application theme api 11+. theme replaces appbasetheme 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 attribute unavailable before api v11.
this far:
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <!-- base application theme, dependent on api level. theme replaced appbasetheme 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 alternative apis prior v11?
edit:
updated style transparency suggestion:
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <!-- base application theme, dependent on api level. theme replaced appbasetheme 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>
solved it!
when working api < v11, have remove "android:" element of attribute in style. example:
<style name="liteactionbarstyle" parent="@style/widget.appcompat.light.actionbar.solid.inverse"> <item name="displayoptions"></item> </style>
this how should in styles api >= v11
<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>
also, missing icons when applied on device api < v11. had change icons display:
<item android:id="@+id/actioninvertshake" myapp:showasaction="always" android:contentdescription="@string/shakechangecontentdescription" android:icon="@drawable/shake" android:title="@string/shakeoption"/>
note namespace "myapp" rather "android"
this removes title , icon of app actionbar , displays icons right left.
Comments
Post a Comment