如何在android中隐藏应用程序标题?

我想隐藏应用标题栏。

你可以通过编程来实现:

import android.app.Activity; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; public class ActivityName extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // remove title requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.main); } } 

或者你可以通过你的AndroidManifest.xml文件来完成:

 <activity android:name=".ActivityName" android:label="@string/app_name" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"> </activity> 

编辑:我添加了一些行,以便您可以全屏显示,因为它似乎是你想要的。

使用

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

你可以用编程的方式来做:或者没有操作栏

 //It's enough to remove the line requestWindowFeature(Window.FEATURE_NO_TITLE); //But if you want to display full screen (without action bar) write too getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.your_activity);