I'm trying to remove the blue underline in the action bar overflow icon. Here is the screenshot:
I don't have tabs but I saw some similar answered questions about action bar tabs underline but nothing worked for me. My Base application theme is Theme.AppCompat.Light. Here are the applied styles:
<style name="AppThemeNoActionBar" parent="Theme.AppCompat.Light">
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:activatedBackgroundIndicator">#drawable/nav_drawer_selection</item>
</style>
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="android:windowActionBar">true</item>
<item name="android:windowNoTitle">false</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:actionBarStyle">#style/MyActionBar</item>
<item name="android:actionMenuTextColor">#color/white</item>
<item name="android:actionOverflowButtonStyle">#style/OverFlow</item>
<item name="actionBarStyle">#style/MyActionBar</item>
<item name="actionMenuTextColor">#color/white</item>
<item name="actionOverflowButtonStyle">#style/OverFlow</item>
<item name="android:activatedBackgroundIndicator">#drawable/nav_drawer_selection</item>
</style>
<style name="MyActionBar"
parent="#style/Widget.AppCompat.ActionBar">
<item name="android:titleTextStyle">#style/MyActionBarTitleText</item>
<item name="android:background">#color/red</item>
<item name="titleTextStyle">#style/MyActionBarTitleText</item>
</style>
<style name="MyActionBarTitleText"
parent="#style/TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">#color/white</item>
</style>
<style name="OverFlow"
parent="#style/Widget.AppCompat.ActionBar">
<item name="android:src">#drawable/ic_launcher</item>
</style>
Thanks for all the help! If you need more info about the app and code let me know :)
#nejc.m i think it's due to inheritance from the "Widget" parent. Try replacing "Widget.AppCompat.ActionBar" with "Theme.AppCompat.Light.DarkActionBar". Let me know if this works.
I played around and I found out that it's a very easy solution. I added <item name="android:background">#color/red</item> to <style name="OverFlow" parent="#style/Widget.AppCompat.ActionBar">
Related
Hello can any one help me in this how to change the overflow icon to white colour I have tried a lot but it is not coming here is my code can any one help me. Help will be appreciated. Here is the code I think so their is only a minor mistake I'am unable find the mistake please help me.
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="MyTheme" parent="#android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">#style/MyActionBar</item>
<item name="android:textAppearance">#style/MyTheme.ActionBar.Text</item>
</style>
<style name="MyActionBar" parent="#android:style/Widget.Holo.Light.ActionBar.Solid">
<item name="android:background">#336699</item>
<item name="android:actionOverflowButtonStyle">#style/MyTheme.ActionBar.OverFlow</item>
</style>
<style name="MyTheme.ActionBar.OverFlow" parent="#android:style/Widget.Holo.ActionButton.Overflow">
<item name="android:src">#drawable/menu</item>
</style>
<style name="MyTheme.ActionBar.Text" parent="#android:style/TextAppearance">
<item name="android:textColor">#ffffff</item>
<item name="android:textSize">25dp</item>
</style>
<style name="myTheme" parent="#android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">#style/myTheme.ActionBar</item>
<item name="android:actionMenuTextColor">#ffffff</item>
</style>
<style name="myTheme.ActionBar" parent="#android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#336699</item>
<item name="android:actionOverflowButtonStyle">#style/myTheme.ActionBar.OverFlow</item>
<item name="android:titleTextStyle">#style/myTheme.ActionBar.Text</item>
</style>
<style name="myTheme.ActionBar.OverFlow" parent="#android:style/Widget.Holo.ActionButton.Overflow">
<item name="android:src">#drawable/menu</item>
</style>
<style name="myTheme.ActionBar.Text" parent="#android:style/TextAppearance">
<item name="android:textSize">23dip</item>
<item name="android:fontFamily">sans-serif-condensed</item>
<item name="android:textColor">#ffffff</item>
</style>
</resources>
Make your theme dark:
<style name="MyTheme" parent="#android:style/Theme.Holo.Dark">
or you can change the actionbar theme instead:
<style name="MyTheme" parent="#android:style/Theme.Holo.Light.DarkActionBar">
I want to make full translucent action bar like google did, i tried several option, that seems to work on Holo, however they are not "full transparent" in Holo.Light
this is my style so far:
<style name="MyTheme.Translucent" >
<item name="windowActionBarOverlay">true</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="actionBarStyle">#style/MyTheme.ActionBar</item>
<item name="android:actionBarStyle">#style/MyTheme.ActionBar</item>
</style>
<style name="MyTheme.ActionBar" parent="#style/Widget.Sherlock.ActionBar">
<item name="background">#android:color/transparent</item>
<item name="android:background">#android:color/transparent</item>
</style>
and in Oncreate:
getSupportActionBar().setBackgroundDrawable(null);
the result its "almost" what i need
however i see a shade in action bar:
What i want (or something like this)
i found the solution
using
<item name="android:windowContentOverlay">#null</item>
will do the trick to remove the line
please check the link....................
http://cyrilmottier.com/2013/05/24/pushing-the-actionbar-to-the-next-level
**values/themes.xml**
<style name="Theme.TranslucentActionBar" parent="#android:style/Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">#style/Widget.ActionBar</item>
</style>
<style name="Theme.TranslucentActionBar.ActionBar" />
<style name="Theme.TranslucentActionBar.ActionBar.Overlay">
<item name="android:actionBarStyle">#style/Widget.ActionBar.Transparent</item>
<item name="android:windowActionBarOverlay">true</item>
</style>
**values/styles.xml**
<style name="Widget.ActionBar" parent="#android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:background">#drawable/ab_background</item>
</style>
<style name="Widget.ActionBar.Transparent">
<item name="android:background">#android:color/transparent</item>
</style>
In the application I have, I would like to have the actionbar drop down's font to be white. Till now I have the following style:
<style name="Theme.MyApplications" parent="#style/Theme.Sherlock.Light.DarkActionBar">
<item name="actionBarStyle">#style/ActionBar.Solid</item>
<item name="android:textSize">18sp</item>
</style>
<style name="ActionBar.Title" parent="TextAppearance.Sherlock.Widget.ActionBar.Title">
<item name="android:textColor">#android:color/white</item>
</style>
<style name="ActionBar.SubTitle" parent="TextAppearance.Sherlock.Widget.ActionBar.Subtitle">
<item name="android:textColor">#android:color/white</item>
</style>
<style name="ActionBar.Solid" parent="#style/Widget.Sherlock.Light.ActionBar.Solid">
<item name="titleTextStyle">#style/ActionBar.Title</item>
<item name="subtitleTextStyle">#style/ActionBar.SubTitle</item>
</style>
This style gives me a black colored font in android 3.0 and higher. Can someone please help me configure the font to be white ?
The funny thing about this is that the action overflow popup's font appears in white.
for now I just used the simple
<style name="Theme.MyApplications" parent="#style/Theme.Sherlock">
<item name="android:textSize">18sp</item>
<item name="android:textColor">#FFFFFF</item>
</style>
Its simple but it got the job done. And what got the job done was the change in the style's parent.
You have apply the style to the native ActionBar as well:
<style name="Theme.MyApplications" parent="#style/Theme.Sherlock.Light.DarkActionBar">
<item name="actionBarStyle">#style/ActionBar.Solid</item>
<item name="android:actionBarStyle">#style/ActionBar.Solid</item>
<item name="android:textSize">18sp</item>
</style>
<style name="ActionBar.Title" parent="TextAppearance.Sherlock.Widget.ActionBar.Title">
<item name="android:textColor">#android:color/white</item>
</style>
<style name="ActionBar.SubTitle" parent="TextAppearance.Sherlock.Widget.ActionBar.Subtitle">
<item name="android:textColor">#android:color/white</item>
</style>
<style name="ActionBar.Solid" parent="#style/Widget.Sherlock.Light.ActionBar.Solid">
<item name="titleTextStyle">#style/ActionBar.Title</item>
<item name="subtitleTextStyle">#style/ActionBar.SubTitle</item>
<item name="android:titleTextStyle">#style/ActionBar.Title</item>
<item name="android:subtitleTextStyle">#style/ActionBar.SubTitle</item>
</style>
I am trying to implement styling on my Action Bar Sherlock on the following:
Basically the actionbar overflow is to be styled in regards to its background color. I did try the following approach.
<style name="GCTheme" parent="Theme.Sherlock.Light">
<item name="android:textSize">18sp</item>
<item name="android:textColor">#FFFFFF</item>
<item name="actionDropDownStyle">#style/MyDropDown</item>
</style>
<style name="MyDropDown" parent="Widget.Sherlock.Spinner.DropDown.ActionBar">
<item name="android:popupBackground">#7D7D7D</item>
</style>
I also did try implementing the android:actionMenuTextColor and also the android:actionOverflowButton but it says that API 11 or higher is required... Any idea on how this is to be implemented ? Please help.
<style name="GCTheme" parent="Theme.Sherlock.Light">
<item name="android:textSize">18sp</item>
<item name="android:textColor">#FFFFFF</item>
<item name="actionDropDownStyle">#style/MyDropDown</item>
<item name="popupMenuStyle">#style/PopupMenu.Example</item>
<item name="android:background">#00BFFF</item>
</style>
<style name="MyDropDown" parent="Widget.Sherlock.Spinner.DropDown.ActionBar">
<item name="android:popupBackground">#7D7D7D</item>
</style>
<style name="PopupMenu.Example" parent="#style/Widget.Sherlock.Light.ListPopupWindow">
<item name="android:popupBackground">#7D7D7D</item>
</style>
I want my Action Bar spinner to display it's text in white (like in google maps app),
but i'm struggling to get there..
i'm trying something like this:
<style name="Mepo.Spinner" parent="#android:style/Widget.Spinner">
<item name="android:spinnerItemStyle">#style/StandardSpinnerItem</item>
<item name="spinnerItemStyle">#style/StandardSpinnerItem</item>
</style>
<style name="StandardSpinnerItem" parent="#android:style/Widget.TextView.SpinnerItem">
<item name="android:textAppearance">#android:color/white</item>
<item name="android:textColor">#android:color/white</item>
</style>
but that has no effect.
I know this his probably been asked but i can't find the right solution.
any ideas?
p.s i'm actually using sherlock action bar if that matters
in the end this is what i did, maybe this will help someone:
<style name="Theme.Styled" parent="Theme.Sherlock.Light.DarkActionBar">
<item name="actionBarStyle">#style/Widget.Styled.ActionBar</item>
<item name="android:actionBarStyle">#style/Widget.Styled.ActionBar</item>
<item name="actionDropDownStyle">#style/xxx.ActionBar.DropDown.Style</item>
<item name="android:actionDropDownStyle">#style/xxx.ActionBar.DropDown.Style</item>
</style>
<style name="Widget.Styled.ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse">
<item name="background">#0B2F39</item>
<item name="android:background">#0B2F39</item>
<item name="backgroundSplit">#0B2F39</item>
<item name="android:backgroundSplit">#0B2F39</item>
</style>
<style name="xxx.ActionBar.DropDown.Style" parent="Widget.Sherlock.Light.Spinner.DropDown.ActionBar">
<item name="android:background">#drawable/abs__spinner_ab_holo_dark</item>
</style>
if you have any remark or corretions i would love to hear them
If you already use an custom theme(you extended the base theme and customized it) and you want to customize the spinner only for one activity you need to do this:
<style name="Theme.MyTheme" parent="Theme.Sherlock">
... your other items
</style>
<style name="Theme.MyTheme.Spinner" parent="Theme.MyTheme">
<item name="android:spinnerItemStyle">#style/SpinnerItem</item>
<item name="android:spinnerDropDownItemStyle">#style/SpinnerItem.DropDownItem</item>
</style>
<style name="Spinner" parent="#android:style/Widget.Spinner">
<item name="android:spinnerItemStyle">#style/SpinnerItem</item>
<item name="android:spinnerDropDownItemStyle">#style/SpinnerItem.DropDownItem</item>
</style>
<style name="SpinnerItem" parent="#android:style/Widget.TextView.SpinnerItem">
<item name="android:textColor">#android:color/white</item>
</style>
<style name="SpinnerItem.DropDownItem" parent="#android:style/Widget.Holo.Light.DropDownItem.Spinner">
<item name="android:textColor">#android:color/white</item>
</style>
And to use this style in an activity use this:
<activity
android:name=".YourActivity"
android:theme="#style/Theme.MyTheme.Spinner" >
</activity>
If you want to customize the spinner for all the activities(your application) move the items from Theme.MyTheme.Spinner into Theme.MyTheme:
<style name="Theme.MyTheme" parent="Theme.Sherlock">
... your other items
<item name="android:spinnerItemStyle">#style/SpinnerItem</item>
<item name="android:spinnerDropDownItemStyle">#style/SpinnerItem.DropDownItem</item>
</style>