第一种方法:
1.添加style
<style name="fullScreen" parent="AppBaseTheme">
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>
<style name="mystyle" parent="AppBaseTheme">
<item name="android:windowNoTitle">true</item>
</style>
2.AndroidManifest.xml设置。默认隐藏标题栏,SplashActivity设置为全屏
<application
android:name="wang.loveweibo.BaseApplication"
android:allowBackup="true"
android:icon="@drawable/icon1"
android:label="@string/app_name"
android:theme="@style/mystyle" >
<activity
android:name="wang.loveweibo.activity.SplashActivity"
android:theme="@style/fullScreen"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
...
</application>
第二种方法:
在Acitivity的onCreate()方法中设置,注意要在setContentView()前。
无标题栏
requestWindowFeature(Window.FEATURE_NO_TITLE);
全屏
getWindow().setFlags(WindowManager.LayoutParams.FILL_PARENT, WindowManager.LayoutParams.FILL_PARENT);
requestWindowFeature(Window.FEATURE_NO_TITLE);
end