如何启动Android应用程序时,去掉标题? [英] How to remove the title when launching android app?

查看:248
本文介绍了如何启动Android应用程序时,去掉标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经删除的onCreate标题()方法。

I already remove the title in onCreate() method.

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    final ActionBar actionBar = getActionBar();
    actionBar.setHomeButtonEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setDisplayUseLogoEnabled(false);
    actionBar.setDisplayShowTitleEnabled(false);
}

标题不显示。但是,启动应用程序时仍然出现。

The title is not displayed. But still appears when launching the app.

和我可以使用

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

或将

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

到清单文件,因为我使用的动作条。如果我这样做,应用程序崩溃。

into manifest file because I'm using actionBar. If I did that, the app crashes.

所以,我的问题是,有没有办法去除,当应用程序被启动,因为我要去放一个启动画面在这里的称号。谢谢你。

So, my question is, is there any way to remove the title when the app is launching because I am gonna put a splashscreen here. Thanks.

请注意:

谢谢您的回答,但我清楚地说,我已经使用 actionBar.setDisplayShowTitleEnabled(假); 隐藏活动的标题栏。 (如图所示,第一画面) 但标题栏仍然出现在启动画面(如图所示第二张照片。)

Thanks for your answers, but I clearly said that I already used actionBar.setDisplayShowTitleEnabled(false); to hide the title bar of the activity. (as shown in the first picture) BUT the title bar still appears in the launching screen (as shown in the second picture.)

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

将导致崩溃启动。发生这种情况后,我用动作条。

would lead to crash launch. This happens after I used actionbar.

推荐答案

我有同样的问题。

就个人而言,我从我的置换活动的继承解决了它 ActionBarActivity到活动。

Personally, I solved it by replacing my Activity inheritance from ActionBarActivity to Activity.

希望这会帮助别人......

Hope this will help someone...

这篇关于如何启动Android应用程序时,去掉标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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