---
title: "Android 去掉窗口标题和程序全屏"
author: "daoshud1"
date: "2013-04-22T13:52:09Z"
tags: []
categories: ["移动开发"]
slug: "android"
draft: false
lastmod: "2013-04-22T13:52:09Z"
id: 1851362
url: "https://daoshud1.iteye.com/blog/1851362"
---

第一：在程序代码中实现

```java

this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏 
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//去掉信息栏

```

注意：这两行代码要写在页面显示之前，即setContentView(R.layout.XXX)之前
第二：在AndroidManifest.xml配置文件中实现标签android:theme

```java
<activity android:name="Activity1" 
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"></activity>
```

注意：如果不需要全屏，只需要写成android:theme="@android:style/Theme.NoTitleBar即可