如何实现Android的选项卡菜单,而不去precated tabhost [英] How to Implement Android tab menu without deprecated tabhost

查看:140
本文介绍了如何实现Android的选项卡菜单,而不去precated tabhost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题听起来简单,但我似乎无法找到为此提供足够的答案。

我试图来设计平板电脑的应用程序具有在屏幕上方季度的一些信息,然后一个标签式菜单下面的前1/4的信息。

基本上我寻找的是:

<$p$p><$c$c>┌─────────────────────────────────────

│页首

├───────┬───────┬───────┬───────┬─────
│标签│1表2│标签│3表4│
│└───────┴───────┴───────┴─────

│页面底部




我本来打算使用多个选项卡的tabhost;但我知道它现在pcated德$ P $,所以我在寻找最有效的,最多最新的方法,这样做Android的发展。
最简单的事情已经实施将是行动吧,但是这是在应用程序顶部 - 而这并不完全是我想要去任何

我读了另一个线程片段应改为使用;但考虑tabhosts的简单,我不太看的片段是如何取代这个,因为,到目前为止,我所知道的,它没有内置的标签选项;只有列表。 (当然,我可能是错的)

我已经找到了其他的选项是ActionbarSherlock,只是使用改变布局的按钮。

我想总体什么我问的是,什么是重现设计我在那里的最好,最先进的最新向后兼容的方​​式是什么?

编辑:
到目前为止,我已经从研究发现的唯一的事情还是说明我使用的片断和兼容性API,或者干脆使用按钮和一个的FrameLayout。
我真的没有兴趣用行动吧,因为它不走那应该是顶部的布局之下。

还是会真的有那么糟糕,只是继续前进,反正用TabHost,即使它去precated?


解决方案

您可以使用:

操作栏在android系统

My question sounds simple, but I can't seem to find a sufficient answer for this.

I'm trying to design an app for tablets that has some information at the top quarter of the screen, and then a tabbed menu for information below the top quarter.

Basically what I'm looking for is :

┌─────────────────────────────────────
│
│ Top of Page
│
├───────┬───────┬───────┬───────┬─────
│ Tab 1 │ Tab 2 │ Tab 3 │ Tab 4 │
│       └───────┴───────┴───────┴─────
│
│ Bottom of page
│
│
│
⁞

I was originally going to use a tabhost with multiple tabs; but I realize that it's deprecated now, and so I'm looking for the most efficient, and up-to-date method for doing this for Android development. The easiest thing already implemented would be the action-bar, but that's at the top of the app -- and that's not quite what I'm trying to go for either.

I read on another thread that Fragments should be used instead; but considering the simplicity of tabhosts, I don't quite see how a fragment can replace this because, so far as I can tell, it doesn't have a built-in tab option; only lists. (Of course I may be wrong)

The other options I have found were ActionbarSherlock, and just using buttons that change layouts.

I guess overall what I'm asking is, what is the best, most up-to-date backwards-compatible way to reproduce the design I have up there?

EDIT: So far the only thing I have found from researching is still stating that I use fragments with the compatibility API, or simply using buttons and a FrameLayout. I'm really not interested in using the action-bar, as it does not go below the layout that is supposed to be on the top.

Or would it really be so bad to just go ahead and use the TabHost anyway, even though it's deprecated?

解决方案

You can use:

Action Bar in android

这篇关于如何实现Android的选项卡菜单,而不去precated tabhost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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