米娅的android之旅
android开发群群号:84926730

去掉标题栏:

<application android:icon="@drawable/icon"  android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar">

或者代码里:

requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏

注意这句一定要写在setContentView()方法的前面,不然会报错的。而且这种有时候会看到程序启动后标题栏闪一下消失的情况。

自定义主题去掉标题栏:在res/values目录下,新建style.xml

<?xml version="1.0" encoding="UTF-8" ?>

<resources>

<style name="notitle">

<item name="android:windowNoTitle">true</item>

</style>

</resources>

然后在AndroidManifest.xml文件中定义

<application
      android:icon="@drawable/icon"
      android:label="@string/app_name"
      android:theme="@style/notitle" >

三种方法,当然是第一种最简单最省事。

保持全屏的方法:一共三种:

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
        <application
            application=""
            android:icon="@drawable/icon"
            android:label="@string/app_name"
            android:theme="@style/fullscreem" >

 

 

 

posted on 2012-07-20 14:34  程序缘儿  阅读(1643)  评论(0编辑  收藏  举报