问题
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.
回答1:
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.
回答2:
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
来源:https://stackoverflow.com/questions/7091126/show-tab-bar-and-listin-actionbar-at-same-time-android-honeycomb