Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display both normal and split ActionBar?

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.

see upper right corner

like image 972
tasomaniac Avatar asked Aug 22 '12 16:08

tasomaniac


1 Answers

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);
like image 88
Michel-F. Portzert Avatar answered Nov 19 '22 01:11

Michel-F. Portzert