之前在AndroidManifest.xml中,android:theme="@style/AppTheme"属性之前是空的,如下:
<application
android:name=".app.AppContext"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
</application>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
All customizations that are NOT specific to a particular API-level can go here.
</style>
要想隐藏状态栏,就要修改values/styles.xml文件,如下
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
<!-- 隐藏状态栏 -->
<!-- <item name="android:windowFullscreen">true</item> -->
<!-- 隐藏标题栏 -->
<item name="android:windowNoTitle">true</item>
</style>
这时开启软件首页就没有标题栏闪过。