对于标签导航最佳实践? [英] Best practice for tab navigation?

查看:101
本文介绍了对于标签导航最佳实践?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找使用标签导航与福尔摩斯动作条的最佳实践。 是什么改变了片段,并添加片段与backstack和清除后退堆栈时,选择其他选项卡的正确方法。

I am looking for best practice of using tab navigation with sherlock actionbar. What is the proper way of changing the fragments, and adding fragments to the backstack and clearing the back stack when another tab is selected.

有没有什么好的例子或开源项目展示了如何做是正确的?

Are there any good examples or open source projects showing how to do it right?

推荐答案

我不会用ABS直接做到这一点。你会遇到麻烦,一旦你的标签所需要的片段切换等等。我认为正确的方式来做到这一点是使用ViewPagerIndicator,这与ABS兼容。作为奖励,你还可以获得刷卡右 - 左选项卡之间。 您需要compat的包(像ABS),例如使用可以在找到 <一href="https://github.com/JakeWharton/Android-ViewPagerIndicator/tree/master/sample/src/com/viewpagerindicator/sample">samples文件夹。

I wouldn't use ABS directly to do that. You will run into trouble once your tabs require fragment switching etc. I think the right approach to do this is to use ViewPagerIndicator, which is compatible with ABS. As bonus you also get the swipe right-left between tabs. You need the compat package (like for ABS), example usage you can find in the samples folder.

这篇关于对于标签导航最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆