---
title: "Android中全屏无标题设置"
author: "DanielHan"
date: "2014-09-24T13:06:25Z"
tags: []
categories: ["移动开发"]
slug: "android"
draft: false
lastmod: "2014-09-24T13:07:40Z"
id: 2119966
url: "https://danielhan.iteye.com/blog/2119966"
---

方法一：在java代码中实现

```java

this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
WindowManager.LayoutParams.FLAG_FULLSCREEN);

```


方法二：在AndroidManifest.xml中根据需要在<application/>或<activity/>中使用Android系统定义的Android主题方式进行设置

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

```


方法三：先在res/values下创建一个styles.xml文件，在文件中写入如下内容

```xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="theme_fullScreen">
        <!-- 设置无标题 -->
        <item name="android:windowNoTitle">true</item>
        <!-- 设置全屏 -->
        <item name="android:windowFullscreen">true</item>
    </style>
</resources>

```

然后，在AndroidManifest.xml中根据需要在<application/>或<activity/>中使用自定义的Android主题方式进行设置

```xml

android:theme="@style/theme_fullScreen"

```