在底部的ActionBar福尔摩斯标签 [英] ActionBar Sherlock Tabs on the bottom

查看:110
本文介绍了在底部的ActionBar福尔摩斯标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能吗?

我可以使用的片段,我可以把底部的标签,但我不能用动作条福尔摩斯。没有任何人有任何想法怎么办呢?

I can use fragments, and I can put the tabs on the bottom, but I can't with ActionBar Sherlock. Does anybody have any idea how to do it?

我使用的是像这样的东西用标签(他们是在底部):

I'm using something like this to use the tabs (they're on the bottom):

tHost = (TabHost) findViewById(R.id.tabhost2);

    tHost.setup();

    tM = new TabManager(this, tHost, android.R.id.tabcontent);

    tM.addTab(tHost.newTabSpec("tabCREATE").setIndicator("Criar"),
            Criar.CountingFragment.class, null);

    tM.addTab(tHost.newTabSpec("tabCREATE2").setIndicator("Criar2"),
            Criar.CountingFragment.class, null);

我怎样才能将其更改为动作条选项卡?

How can I change it to the ActionBar tab?

我通常使用本作的动作条:

I normally use this for the actionbar:

getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

    for (int i = 1; i <= 3; i++) {
        ActionBar.Tab tab = getSupportActionBar().newTab();
        if (i == 1) {
            tab.setText("a");
        }
        else if(i == 2)
            tab.setText("b");
        else if (i == 3)
            tab.setText("c");
        tab.setTabListener(this);
        getSupportActionBar().addTab(tab);

和它的罚款,但我真的需要把它的底部。是否有可能在该第二种方法设置Tabhost?如何?我相信,这将解决我所有的问题。

And it's fine, but I really need to put it on the bottom. Is it possible to set the Tabhost on that second method? And how? I believe that it would solve all my problems.

推荐答案

我觉得不能用动作条做到这一点。 安卓uiOptions =splitActionBarWhenNarrow只是增加了动作条在屏幕底部多余的空间,但是这将是只为的MenuItems而不是标签。 动作条设计准则总是在顶部有标签。看看 http://www.androiduipatterns.com/2011 /07/tabs-top-or-bottom.html 哪里是一个很好的讨论,其中标签应设。

I think you can't do it with ActionBar. android:uiOptions="splitActionBarWhenNarrow" just adds extra space for ActionBar to the bottom of the screen but it will be only for MenuItems and not for tabs. ActionBar design guidelines always has tabs at top. Take a look at http://www.androiduipatterns.com/2011/07/tabs-top-or-bottom.html where is a nice discussion where tabs should be located.

这篇关于在底部的ActionBar福尔摩斯标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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