Android Studio-删除操作栏 [英] Android Studio - Action Bar remove

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

问题描述

我正在尝试删除/禁用ActionBar.我试图放入清单:

I'm trying to remove/disable the ActionBar. I tried to put in the Manifest:

<activity
    ...
    android:theme="@android:style/Theme.NoTitleBar"
</activity>

,它不起作用.它不会删除ActionBar. 请帮我. 谢谢.

and it doesn't work. It doesn't remove the ActionBar. Please help me. Thanks.

推荐答案

在您的oncreate()方法中使用此

getActionBar().hide();

如果您的minSdkVersion为10或更低,请使用:

If your minSdkVersion is 10 or lower, instead use:

getSupportActionBar().hide();

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

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