Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show tab bar and listIn Actionbar at same time. (Android Honeycomb)

There is a situation in which I want to use Tab bar as well as List navigation, Both at same time in Action bar.

Documentation says 'we can put Actionbar in to list navigation mode or tabs navigation mode'.

Is there any way to use both at same time. Any pointers, help. Thank you in Advance.

like image 746
Sagar Avatar asked Aug 17 '11 10:08

Sagar


2 Answers

Sorry, you can only have one or the other.

That being said, you can use android:actionLayout to convert an options menu item into a custom inflated layout in the action bar. You might be able to use the "tabs navigation mode" while putting your own Spinner to the right of the tabs this way. Personally, I would find this confusing as a user, but perhaps it will work for your use case.

like image 104
CommonsWare Avatar answered Oct 21 '22 01:10

CommonsWare


a very late answer, but this is possible by a simple hack. You just have to replace (programatically) the view that is pointed by android.R.id.action_bar_title with a Spinner. I wrote a blog about it. Here's the link

like image 36
sha256 Avatar answered Oct 21 '22 01:10

sha256