App 启动页白屏优化,大家有没有什么好的方案
app 在桌面上被点击之后,会先经历一段白屏,白屏过后才会显示正常的 Splash 页面,大家有没有什么好的方案解决这个?白屏时间一般受到 冷启动 和 热启动的影响,其中 冷启动 白屏时间最长,热启动稍微好点。但是如果 app 过于庞大,虽然 application 中做的操作不多,但依然还是会出现白屏
Theme设置 window:background
Hidetag [email protected]于2018年4月16日 周一上午11:45写道:
app 在桌面上被点击之后,会先经历一段白屏,白屏过后才会显示正常的 Splash 页面,大家有没有什么好的方案解决这个?白屏时间一般受到 冷启动 和 热启动的影响,其中 冷启动 白屏时间最长,热启动稍微好点。但是如果 app 过于庞大,虽然 application 中做的操作不多,但依然还是会出现白屏
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/android-cn/android-discuss/issues/696, or mute the thread https://github.com/notifications/unsubscribe-auth/ADM4ZWxk_OMS_A4BtkVK3Iur_3pCuP2zks5tpBO9gaJpZM4TV00N .
-- 发自移动版 Gmail
就是楼上那种。不过如果用图片做背景的话要注意可能引发的oom。
参考 https://www.bignerdranch.com/blog/splash-screens-the-right-way/ 就是别setContentView() 直接在主题里面设置背景
启动页的Style中设置背景图片,也就是启动页的图片,秒起,但是注意,会有变形问题