启动白屏
① 为启动Activity配置一个自定义的背景
<style name="AppTheme.Launcher">
<item name="android:windowBackground">@drawable/splash_image</item>
</style>
可以是闪屏页面,也可以是透明背景,这样启动时会停顿一下再打开,不过在小米2A上测试时是黑屏一段时间,具体原因未知。
②给启动的Activity配置该theme
③在启动的Activity里onCreate中恢复原来的theme,使用setTheme(int resId)方法
网友评论