消除 activity 启动时白屏、黑屏问题
2015-03-13 10:40
323 查看
默认情况下 activity 启动的时候先把屏幕刷成白色,再绘制界面,绘制界面或多或少有点延迟,这段时间中你看到的就是白屏,显然影响用户体验,怎么消除呢?
在 Activity theme 设置style 即可
[html] view
plaincopy
<style name="AppTheme" parent="android:Theme.Light.NoTitleBar">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowBackground">@android:color/transparent</item>
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
[html] view
plaincopy
<application
android:name="com.skymobi.moposns.MyApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.skymobi.moposns.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
转自http://blog.csdn.net/z1074971432/article/details/10533735
在 Activity theme 设置style 即可
[html] view
plaincopy
<style name="AppTheme" parent="android:Theme.Light.NoTitleBar">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowBackground">@android:color/transparent</item>
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
[html] view
plaincopy
<application
android:name="com.skymobi.moposns.MyApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.skymobi.moposns.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
转自http://blog.csdn.net/z1074971432/article/details/10533735
相关文章推荐
- 消除 activity 启动时白屏、黑屏问题
- 消除 activity 启动时白屏、黑屏问题
- 消除 activity 启动时白屏、黑屏问题
- 消除 activity 启动时白屏、黑屏问题
- 消除 activity 启动时白屏、黑屏问题
- 消除 activity 启动时白屏、黑屏问题
- activity 启动白屏黑屏问题
- Android编程中activity启动时出现白屏、黑屏问题的解决方法
- activity 启动时短暂黑屏问题
- android启动时白屏或者黑屏的问题
- 解决Activity启动黑屏及设置android:windowIsTranslucent不兼容activity切换动画问题
- 解决app启动时白屏或者黑屏问题
- 解决Activity启动黑屏及设置android:windowIsTranslucent不兼容activity切换动画问题
- Android解决APP启动白屏或者黑屏闪现的问题
- 解决Activity启动黑屏及设置android:windowIsTranslucent不兼容activity切换动画问题
- 解决Activity启动黑屏及设置android:windowIsTranslucent不兼容activity切换动画问题
- 【原】android启动时白屏或者黑屏的问题
- app启动前闪现白屏、黑屏问题解决
- 解决Android应用启动时白屏或者黑屏的问题
- Android 编程日记 解决应用启动时白屏或者黑屏的问题