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

大城市里の小女人 提交于 2019-12-23 07:03:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!