android-actionbar

Android (ActionBarSherlock) Is there any way to keep the same ActionBar height both in portrait and landscape?

本秂侑毒 提交于 2019-12-04 10:35:33
问题 I have been working with the ActionBar and ActionBarSherlock for the last few days, and i am having some issues when filling some information in the ActionBar. When the application runs in portrait mode, the ActionBar looks fine, and all the data can be displayed, for example: But when i switch the app to be displayed in landscape, some of the data is cropped: You can notice how both the status icon and the email has been cropped due to the new height of the ActionBar. In this case, i want to

How to change SearchView default icon?

南楼画角 提交于 2019-12-04 10:29:43
问题 I've used "Android Action Bar Style Generator" in order to generate my own Holo theme. Then I've added two icons to the action bar, one for a searchFilter and one for a file picker, both icons are white . File picker icon (at the right) looks good, but somehow search icon looks dark grey. When typing on the search text view, close button also looks dark grey. I've tried changing color of the actionbar and also from the searchview, without success. Why is the search view showing this color?

On/Off Toggle Button in Preferences & Action Bar - Ice Cream Sandwich Style

ε祈祈猫儿з 提交于 2019-12-04 10:15:36
问题 I am referring to the blue ON/OFF styling as seen in the default Android Settings app on ICS phones. It can also be seen here: http://android-developers.blogspot.com/2012/02/android-design-v2-now-with-stencils.html I want to put them in a Preference screen, would I have to use a custom preference widget? Also, is it easy to put toggle buttons in the Action Bar? It seems to be possible since it is done for Wifi Settings in the default Android Settings on ICS, but it is probably a custom menu

Items in ActionBarCompat are showed always in Overflow

て烟熏妆下的殇ゞ 提交于 2019-12-04 10:07:29
问题 I'm using ActionBarCompat in my app, an I want to show one or two items in the action bar I follwed the guide of google developers, but when I test it, the items are showed in the "Overflow" option (in Nexus 4) and if I tap on the menu button if there exist (ex. Galaxy S3) What I've doing wrong? SOLUTION FOUND You can find it in a answer. 回答1: I had the same problem, and found two solutions: In the menu xml (Login.xml), use your app name for the showAsAction tag: instead of: <item android:id=

Android: Hide ActionBar, keep Tabs

南楼画角 提交于 2019-12-04 09:59:24
问题 To keep this simple: I have tabs in my actionbar, but the action bar take up too much space. I want that extra space. I need a way to hide the action bar, yet keep my tabs. Is there anyway to do this? Or is there a way I can get the tabs built into the action bar like it is in landscape mode? Thanks! 回答1: You can have an empty Actionbar, then the tabs will occupy the space: getSupportActionBar().setDisplayShowHomeEnabled(false); getSupportActionBar().setDisplayShowTitleEnabled(false); 回答2:

Can I disable ActionBar's navigation Spinner?

戏子无情 提交于 2019-12-04 09:51:29
What I want to achieve is disabling all items on ActionBar except one. I have a custom ActionBar with Menu ,several TextViews , one Button and a Spinner from ListNavigation. Spinner is created because of bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); like this : SpinnerAdapter spinnerAdapter = new ArrayAdapter<String>(this.getActivity(), R.layout.action_bar_spinner, names); // "listener" for spinner bar.setListNavigationCallbacks(spinnerAdapter, new OnNavigationListener() { @Override public boolean onNavigationItemSelected(int position, long itemId) { // do some stuff return true; } })

Changing the ActionBar hide animation?

扶醉桌前 提交于 2019-12-04 07:57:24
问题 By default in Android 3.0+, when ActionBar.hide()/show() are called the bar is animated with a brief fade in/out animation. There does not seem to be an XML style attribute in this list associated with an animation resource. Is there some way to change this animation? In my case, I simply want to change the animation time, but is it also possible to have a sliding animation? 回答1: No. At least not in 3.0, 3.1, or 3.2. If you look at the decompiled sources of com.android.internal.app

dynamic drawable icon for ActionBar menu item? (Android, ActionBarSherlock)

a 夏天 提交于 2019-12-04 07:55:37
问题 How can I dynamically update the icon for an ActionBar MenuItem to show a 'red badge' with a number? (conceptually similar to "unread message count') I'm using ActionBarSherlock in my Android application, targeting API level 10+. My application is for mobile data capture and, sometimes, the user cannot immediately submit new data but must save it locally on the phone (e.g. when connectivity is poor). Whenever there are 'unsubmitted' items stored locally on the phone, I'd like to show the user

How resize the Action Bar Menu Text Size in Android [duplicate]

南楼画角 提交于 2019-12-04 07:54:57
This question already has an answer here: How to change size of title's text on Action Bar? 5 answers I am developing the android application. have one doubt regarding reduce the text size for action bar menu item. this my code. <style name="MyActionBar.MenuTextStyle" parent="android:style/TextAppearance.Holo.Widget.ActionBar.Menu"> <item name="android:textColor">#888888</item> <!-- <item name="android:textStyle">bold</item> --> <item name="android:textSize">10dip</item> <item name="android:textAppearance">@android:style/TextAppearance.Medium</item> </style> Thanks in advance.. SilentKiller

How can I change the 'little triangle color' in action bar NAVIGATION_MODE_LIST

淺唱寂寞╮ 提交于 2019-12-04 07:51:22
After I set action bar to NAVIGATION_MODE_LIST getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); and then set an adapter for it. The list show up as expected, but I need to change the 'little triangle' color of the list as the default color is very close to my background color . Is it possible to do this, if so, how can I do it? The little triangle you want to change is in the background of a Spinner widget in ActionBar . The background is a state list drawable . Items of the state list drawable are 9-patch drawables like this one (this particular one is the hdpi version for