I use ActionBarSherlock on my app compiled with Android 4.0.3.
When testing on my device running JellyBean 4.2.1, I can see the overflow icon both in the ActionBar and in the bottom buttons bar.
See Screenshot.
How can the bottom overflow button be removed?
EDIT: Both buttons work!
Increase your android:targetSdkVersion to 14 or higher, as I outline in this blog post.
I create a menu like that in my app and have some items in a menu.xml that looks like this:
<item
android:id="#+id/menu_main_about"
android:orderInCategory="100"
android:showAsAction="never|withText"
android:title="Acerca de"/>
Maybe you are supplying some extra or different attributes that cause that behavior. Please try with this to confirm that.
In the samples that brings the ActionBarSherlock, one's of these are what you need.
Related
i recently updated the appcombat library to integrate the material design.
But there is an issue with the style "Theme.AppCompat.Light.DarkActionBar", because if i use this style and let my TextView like:
android:textAppearance="?android:attr/textAppearanceSmall
the whole text appears invisible (or just white) on a white background
If a use the "Theme.AppCompat.Light" theme, everything is working fine.
This issue i have only on Devices running android 2.3.*
Samples: (Don't have enough reputation to post images, so you need to click)
DarkActionBar:
Light:
Any suggestions guys? Anyone tried the new appcombat library with Gingerbread?
Obviously i found out that i need to use material text appeareance, for instance:
android:textAppearance="#style/TextAppearance.AppCompat.Body1"
See also:
http://www.google.com/design/spec/style/typography.html#typography-roboto-noto
I originally had this working with ActionBarSherlock but since re-working my code to use the android.support.v7 libraries I'm seeing a blurred blue overlay when the SearchView is expanded.
The following is a screenshot from my Nexus 7 with the soft keyboard open.
When I close the keyboard the blurred blue image disappears but there is still a blur to the SearchView as in the image below.
I'm using a menu xml file to create the various menu items - the search item is as follows...
<item android:id="#+id/options_menu_search"
android:title="#string/search"
android:icon="#android:drawable/ic_menu_search"
com.mycompany.mypackage:showAsAction="ifRoom|collapseActionView"
com.mycompany.mypackage:actionViewClass="android.support.v7.widget.SearchView" >
</item>
It does actually work in the sense I can perform searches but for the life of me I can't work out where the blurred images are coming from.
I did find this SearchView drawables in ActionBar appear blurred but the accepted answer doesn't apply to my problem as I'm not creating the SearchView programatically.
Has anybody seen anything similar and found a fix?
I eventually found an answer to this problem. It seems like a bug in the Build Tools. Anything from v18 onwards causes this problem and I'm now sticking with Build Tools v17.
See this question and the OP's own answer (particularly the EDIT at the end)...
Searchview on support.v7.appcompat.library issue: default 9-patch background not renders properly
I want to create a custom title bar, somewhat like this, in my Android app. Please pardon if my question seems idiotic, I'm a beginner. Can anyone tell me if it is a titlebar or an Action bar? Plus how can I give this Shaded Black color to my titlebar/action bar?
PS: I'm using GingerBread on my Android. My app will require minimum SDK version to be 4 but it targets Jelly bean too. In GingerBread, I can't make use of ActionBars. Please help me with the problem. It would be highly appreciated.
You will want to use the ActionBarSherlock library for this (which will allow you to use this all the way back to SDK version 4).
It is reasonably easy to style, and is for sure the right way to do this. Lots of examples for this, as it is a very popular library.
http://actionbarsherlock.com/
If you are wanting to target min API 4, then as you state you'll be unable to use the ActionBar.
So you could just create your bar as a LinearLayout or something with whatever buttons / icons you want on it and have it at the top of all of your Activities. If you have many of them it would probably be worth it to refactor the Bar (click handlers and such) handling into a subclass of Activity, and then extend that with all of your other activities.
The visual effect could be easily achived with a 9-patch png set as the background of a LinearLayout. Just make the gradient you want in photoshop/Gimp and drop it into draw9Patch to add the pixels on the edge that will allow it to stretch nicely to fit any screen.
Edit: using actionbar sherlock as others suggested is probably a better idea than doing it "manually" as I suggested.
i am trying to customize my action bar, and willing to put some actions into the overflow, so i used showAsAction="ifRoom" in my menu xml file.
the problem is, my action bar doesn't want to take more than 2 action(is this normal?), and don't show the overflow menu which is supposed to be included if there's not enough space in screen.
any hints or solutions please?
Thank you
To get it to show on an Android 4.0 device (not 100% sure it will work on older devices, but it may with the compatability package) I also had to add android:uiOptions="splitActionBarWhenNarrow" to the AndroidManifest.xml file in either the <application /> or <activity /> section depending on the usage you want.
Also, showAsAction="ifRoom" will most likely not show them... try using showAsAction="always" to get it working at least and then try playing with them!
Hope this helps....
I've just met some troubles in Android 4.0.3 with menu because it displays menu item in a list. But I can't a way to set it displaying in a grid-like layout.
Appreciate help.
My friend, I found the main reason why you couldn't display option menu as grid-style in Android 4.0.3.
Because you used #android:style/Theme.Holo for your application.
Menu of Theme.Holo was set for displaying in list-style.
The solutions are:
1, Try to use another theme such as #android:style/Theme.Wallpaper.NoTitleBar instead of #android:style/Theme.Holo.Wallpaper.NoTitleBar
2, Or if you still want to use Theme.Holo, so try to create a style for menu in values/style.xml. References: see styles in Android Framework. (Sr, I don't have Android framework here, so I can't show you what to do exactly now)
Hope this help!