且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

requestWindowFeature(Window.FEATURE_NO_TITLE);在Froyo和Gingerbread中不起作用

更新时间:2023-11-19 10:54:10

如果要删除标题,只需将此样式添加到清单文件中即可.

If you want to remove the title, just add this style into your manifest file.

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

然后出现问题,通知您必须使用appcompat库的派生类.这是因为您使用的是支持库v7,&在创建项目时,会创建一个活动,该活动不会作为Activity类扩展,而会作为ActionBarActivity类扩展.

then the problem arises, notifying that you must use a derivative of an appcompat library. this is because you are using the support library v7, & on creating your project, an activity creates which doesn't extends as an Activity class, but ActionBarActivity class.

因此,如果您确实要使用支持库,请创建您在值,values-v11,values-v14文件夹&下创建的主题.在主题清单上应用主题.

so, if you really want to use the support library, create the theme that you created under values, values-v11, values-v14 folders & apply your theme on your manifest.

否则,将您的ActionBarActivity类更改为Activity类&将Theme.Black.NoTitleBar主题应用于清单.

else, change your ActionBarActivity class into Activity class & apply Theme.Black.NoTitleBar theme to your manifest.

希望有帮助.