正在显示操作栏下方的标签 [英] Action bar being shown below its tabs

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

问题描述

当我设置这些属性:

    actionBar = getSupportActionBar();

    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setTitle("Title");
    actionBar.setLogo(null);

    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

动作条低于其标签

但是,如果我评论此像:

But if i comment this Like:

actionBar.setDisplayShowHomeEnabled(false);

它工作正常。但我想这是的理由是,避免APPICON被显示。

It works fine. But the reason i want it to be false is, to avoid the appIcon being shown.

感谢您

推荐答案

我GOOGLE了这个问题,并发现gitub这个线程:<一href="https://github.com/JakeWharton/ActionBarSherlock/issues/327">https://github.com/JakeWharton/ActionBarSherlock/issues/327

I googled this problem and found this thread on gitub: https://github.com/JakeWharton/ActionBarSherlock/issues/327

您可以读取线程,但得出的结论是:

You can read the thread, but the conclusion is:

你好。刚刚发现一个简单的解决方法。

Hi. Just found a simple workaround.

使用下面你onCreate方法:   
  查看homeIcon = findViewById(android.R.id.home);    
  ((查看)homeIcon.getParent())setVisibility(View.GONE)。   
  这完全崩溃的home键。

Use the following in your onCreate method :
View homeIcon = findViewById(android.R.id.home);
((View) homeIcon.getParent()).setVisibility(View.GONE);
this collapses the home button completely.

PS:我使用的标准动作条但这应该工作一样

PS : i'm using standard ActionBar but this should work the same

我希望这可以帮助你,
丹尼尔。

I hope this helps you out,
Daniel.

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

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