I have more then a few ActionBar items, and I am using splitActionBarWhenNarrow option. Latest Gmail app also uses it. But it also have a custom item on upper right that shows the current number of unread emails. When I use splitActionBar it sends all my action items to the bottom. How can I send some of them to bottom and force some of them to be in the upper side.
Asked
Active
Viewed 1.3k times
18
-
I have heard that it is currently not possible although don't remember the reference. – Alexander Kulyakhtin Aug 22 '12 at 16:52
1 Answers
23
When the ActionBar is splitted (using android:uiOptions="splitActionBarWhenNarrow"
), all menu items automatically go to the bottom bar but custom view can still be put in the top.
View customNav = LayoutInflater.from(this).inflate(R.layout.custom_view, null);
getActionBar().setCustomView(customView);

Michel-F. Portzert
- 1,785
- 13
- 16
-
Woooow that is fantastic. I havent used any custom view for action bar but I definitely want to use it. But we cannot put the custom view to the bottom right? – tasomaniac Aug 22 '12 at 22:42
-
2I'm nearly sure you can't put a custom view on the bottom.. but here: http://stackoverflow.com/questions/11816041/android-actionbar-push-custom-view-to-bottom-of-screen is a recent similar question, and somehow the author found a way to make sort of a custom view from a menu item. I tested it, it works for me. – Michel-F. Portzert Aug 23 '12 at 00:40