Android,没有操作栏的标签 [英] Android, Tabs without Actionbar

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

问题描述

这个问题已经被问到了(例如,这里

要禁用操作栏图标和标题,您必须做两件事:

 setDisplayShowHomeEnabled(false);//隐藏操作栏图标setDisplayShowTitleEnabled(false);//隐藏操作栏标题

按照

下面是一些非常有用的链接.请参考.

从下面的链接下载示例 zip

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

或参考这些链接

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

http://www.exoguru.com/android/material-design/navigation/android-sliding-tabs-with-material-design.html

http://www.truiton.com/2015/06/android-tabs-example-fragments-viewpager/

https://guides.codepath.com/android/Google-Play-Style-Tabs-using-TabLayout

这可能会帮助你...

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.

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.

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

解决方案

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

To disableAction-bar Icon and Title, you must do two things:

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

Follow The Steps given in Using split action bar

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...
}

After Android updated Actionbar to Toolbar there are many changes in Actionbar Tabs.

Please follow below links to create swipable tabs in Andoid.

Design Structure :

Tabs Design Guidelines

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

Download sample zip from below link

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

Or Refer these links

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

http://www.exoguru.com/android/material-design/navigation/android-sliding-tabs-with-material-design.html

http://www.truiton.com/2015/06/android-tabs-example-fragments-viewpager/

https://guides.codepath.com/android/Google-Play-Style-Tabs-using-TabLayout

This may help you...

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

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