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.
Related
We are having an application with three activities.
1) startup Activity which doesn't have any actionbar or navigation drawer (splash)
2) Main Activity with action bar
3) Another Activity with action bar
The theme is Theme.AppCompat.Light.NoActionBar
We are facing a strange issue on lollipop phone that white space is shown in notification area without any icons (completely blank) in startup activity and other activity. No issue on Kitkat or earlier phones.
Also, this problem is not encountered with MainActivity having Actionbar and navagation drawer
Any idea what could be wrong? will be happy to provide more details if requires.
You can see screenshot: http://imgur.com/1K9LbWi
This was the issue which somehow went into values-v21/styles.xml, removing it solved. Thanks all of you for answering.
<item name="android:navigationBarColor">#color/myNavigationColor</item>
Your status bar is in white color so you can not see any notification icon. Please change your status bar color with style.xml.
Open your style.xml and change color of colorPrimaryDark attribute.
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
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.
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.
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.
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>