如何像在Google Android Apps中一样加载即时启动屏幕? [英] How to load instant Splash screen like in Google Android Apps?
问题描述
我有一个启动画面活动,它只是相对布局内的图像.
I have a splash screen activity which is just a image inside a relative layout.
加载我的应用程序时,在显示初始屏幕之前,它是纯色的(与windowBackgroud相同).
When my app loads, before the splash screen is shown there is a solid color (same of windowBackgroud).
我如何做到这一点,以使其立即加载我的启动画面,例如Google的Youtube应用程序.
How can I make it so that it will load my splash right away like for example Googles Youtube app.
推荐答案
如果活动主题中未指定背景,则系统会使用默认背景加载活动.为避免黑屏,请添加具有背景色或您想要的图像.将此主题设置为启动活动.
The system loads the activity with default background if no background is specified in the theme of the activity.To avoid blank screen add a custom theme with the background color or image which you want. Set this theme to the splash activity.
有关详细示例,请此处
这篇关于如何像在Google Android Apps中一样加载即时启动屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!