Android的标签没有动作条 [英] Android, Tabs without Actionbar

查看:247
本文介绍了Android的标签没有动作条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题已经被问(例如,在这里使用ViewPager与标签不动作条),但答案有不工作。有一些链接 Swipey 可惜链接太破。

This question has been asked (for example, here Using ViewPager with Tabs without actionBar), however the answer there doesn't work. There's some links to Swipey but unfortunately the link is broken too.

这是Android的网站<一个例子href="http://developer.android.com/training/implementing-navigation/lateral.html">EffectiveNavigation使用动作条主办的标签片段,所以很明显,如果我设置了.NoActionBar主题,那么就没有主机。任何不同的方式?谢谢你。

The example from Android site EffectiveNavigation uses Actionbar to host the tab fragment, so obviously if I set a .NoActionBar theme, then there's no host. Any different way? Thanks.

更新是我想创建,在上面,没有动作条的截图。

Update screenshot of what I want to create, at the top, there's no actionbar.

更新2 这是从谷歌的例子,有在上面的动作条(题为有效的导航条),这是我想摆脱

Update 2 this is from the google example, there's an actionbar on top (titled "Effective navigation), which I want to get rid of

推荐答案

你的问题的解决方案是在 HTTP:/ /developer.android.com/

Solution of your problem is already given in http://developer.android.com/

要disableAction栏图标和标题,你必须做两件事情:

 setDisplayShowHomeEnabled(false);  // hides action bar icon
 setDisplayShowTitleEnabled(false); // hides action bar title

按照采用分体式操作栏

写操作之后code。在 的OnCreate()

Write Following Code in OnCreate()

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.navigation_drawer);

        getActionBar().setDisplayShowHomeEnabled(false);  // hides action bar icon
        getActionBar().setDisplayShowTitleEnabled(false); // hides action bar title
        //rest of your code...
}

后的And​​r​​oid更新的动作条到工具栏也有很多变化,动作条的标签。

请按照下面链接到Andoid创建swipable标签。

Please follow below links to create swipable tabs in Andoid.

设计结构:

标签设计准则

一些非常有用的链接如下。请参阅。

Some of the very useful links are below. Please refer to them.

下载样品从下面的链接拉链

http://developer.android.com/samples/SlidingTabsBasic/index.html

或者参考以下链接

http://www.android4devs.com/2015/01/how-to-make-material-design-sliding-tabs.html

<一个href="http://www.exoguru.com/android/material-design/navigation/android-sliding-tabs-with-material-design.html" rel="nofollow">http://www.exoguru.com/android/material-design/navigation/android-sliding-tabs-with-material-design.html

http://www.truiton.com/2015 / 06 / Android的标签,例如片段-viewpager /

的https://guides.$c$ cpath.com/android/Google-Play-Style-Tabs-using-TabLayout

这可能会帮助你...

This may help you...

这篇关于Android的标签没有动作条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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