What are the official Android recommendations for tabs?

爱⌒轻易说出口 提交于 2019-12-19 04:34:54

问题


I have to say I'm pretty lost when it comes to designing tabbed layouts on Android right now. The platform developers seem to be evolving the design faster than I can figure out their intentions.

From what I can gather from the combination of the recently deprecated TabActivity and the new design guide, I think they intend for tabs to be exclusively with the Action Bar, either inside the main action bar or stacked on a secondary action bar.

Though the developer's guide suggests using the Action Bar for "global navigation". Does this mean that it's recommended to create your own tabs outside the Action Bar if your tabs only apply to a particular application context?


回答1:


"Global" is used in a local context here. :) The intent of that statement is to say that action bar tabs should be used for activity-global navigation, and that you should refrain from using action bar tabs to switch navigation within a sub-pane of the same activity.

This mostly applies to large-screen or tablet layouts where you might have multiple panes of content. If you use action bar tabs in such a configuration, it wouldn't make sense for those tabs to only apply to the right detail pane of the activity but leave a left pane alone. If you wanted tabs that only apply to a single pane of an activity, those tabs should be part of that pane rather than part of the action bar.

Basically, tabs should always be local to the content that they affect. If switching tabs switches between different content for the whole activity window, use action bar tabs. If tabs are more local to a smaller part of your UI, place them closer to the content that will actually change when you select a new tab.



来源:https://stackoverflow.com/questions/12416346/what-are-the-official-android-recommendations-for-tabs

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