I am using sherlock actionbar and made custom action bar using differnt color (blue) . When there are menu items . as i click on menu item . items background turns in to gray . Not able to point which attribute of the style is making this effect had checked the most possibility . any help would be appreciated
after some analysis found following answer
<item name="selectableItemBackground">#null</item>
<item name="android:selectableItemBackground">#null</item>
<item name="actionBarItemBackground">#null</item>
<item name="android:actionBarItemBackground">#null</item>
The issue is you need to override these attributes in your application. donot try changing in actionbar apk libary. that was the point i missed while fixing this.
Related
In my android app, in the Action Bar, next to the < image is an icon. I want to make it invisible/gone ondemand dynamically. How do I do that? The icon is actually defined as follows (this should help you realize where in the action bar I am talking about).
<style name="MyAppName.LogoTheme.LogoActionBar" parent="MyAppName.Theme.ActionBar">
<item name="android:displayOptions">showHome|homeAsUp</item>
<item name="android:icon">#drawable/my_icon</item>
I tried the following, but nothing.
this.getActionBar().setDisplayHomeAsUpEnabled(false);
this.getActionBar().setLogo(null);
this.getActionBar().setDisplayUseLogoEnabled(true);
In Java, call setDisplayShowHomeEnabled(false) and setDisplayShowTitleEnabled(false) on your ActionBar.
So I've basically looked into every resource I saw online on how to change the blue underline in the tabs, but all of the advice has not worked in my case.
I tried actionbarsherlock, appcombat, holo from Action Bar Generator but all the coloring did was color the top action bar, not the tab underline. And yes the files did compile and did not have any errors, but for some reason, it seemed like the underline would never be changed even through the generator.
I am confused on how to change the default blue underline on the tabs, and I would SO EXTREMELY appreciate it if there was a working custom style xml that you would share.
After going to Changing ActionBar tabs underline color programmatically result is still same :/
Screen shot after trying from other page: http://i.stack.imgur.com/EOUbu.png
Anyone able to help me out?
I've been struggling with this for days, but finally found the solution. I'm using AppCompat. You can set colorAccent in your theme and that will change the highlight color on your ActionBar. Like so:
<item name="colorAccent">#color/highlightcolor</item>
Here it is in context:
<style name="LightTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">#color/darkgrey</item>
<item name="colorPrimaryDark">#color/black</item>
<item name="colorAccent">#color/highlightcolor</item>
</style>
You need to define a custom theme for that, and then check the states to change the colour of the line. See if this answer helps you
Not sure if you are still pursuing this, but can you show what you did with Action Bar Generator? What Style entries did you add (in XML) and which drawables did you add?
I just went through the same process and it worked well with Action Bar Generator; just required a few lines added to the styles.xml, a new xml file in drawables folder, and then about 5 new image drawables into each of the resolution size folders (drawable-hdpi, etc).
Hello android developers,
I know this question have been asked many of times, and I have also tried many solutions but they are not working for me.
Firstly I am using action bar sherlock library to show action bar,and I want to show dividers between menu items with icons only.
For that I create custom style for showing divider but they are not showing.
<style name="Theme.SherlockCustom" parent="#style/Theme.Sherlock.Light">
<item name="android:actionBarDivider">#drawable/actionbar_seprator</item>
<item name="android:showDividers">middle</item>
</style>
And also tried to update sherlock library ActionMenuItemView.java for ActionBar where needsDividerBefore() will always give true. But this patch also not worked for me. Please help where I am going wrong. Thanks.
You can't get dividers on versions > 4.0 for your scenario unless you use a custom view for your action bar; the native implementation controls the behavior internally and doesn't give any hook to modify that.
HTH,
Ali.
I use action bar in my app (actionbarsherlock) and I wanted I wanted the title not to be shown but just wiew the logo in ab. So I tried to use
<item name="abDisplayOptions">useLogo</item>
Yes, the title disappeared, but the logo isn't shown anymore. Why? And how can I solve it using just XML?
Ok. I've solved this problem by
<item name="abIcon">#drawable/logo</item>
and then
<item name="abDisplayOptions">showHome</item>
But I do not understand why it didn't work with abLogo.
In my Android application I need to have a black action bar and my content has a white background. The problem is that whenever I set the actionbar with a black background, all my dropdown spinners and textviews have a white background, and I can't see them together with my white content background. If I set the actionbar to white, the dropdown spinners and textviews have a black background and I can see them properly. I tryed customizing the style from the dropdown spinner with android:dropDownSpinnerStyle But i didn't succeed. How can I solve this?
Edit:
I just solved this issue regarding the Dropdown using the following:
<item name="android:dropDownSpinnerStyle">#style/customDropDownStyle</item>
<style name="customDropDownStyle" parent="#android:style/Widget.Holo.Light.Spinner">
</style>
But I still have this issue regarding an EditText, in which I can't see it's background. I just can't find the attribute I should work with in order to solve the issue.
It was much easier to keep the style of the APP in a way that the dropbox/textfields would be visible, but changing only the style of the Actionbar like that:
<item name="android:actionBarStyle">#style/ActionBar.Light</item>
<item name="android:actionOverflowButtonStyle">#android:style/Widget.Holo.ActionButton.Overflow</item>
<item name="android:actionBarTabStyle">#style/customActionBarTabStyle</item>