Activity:
public class SplashActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); startActivity(new Intent(this, MainActivity.class)); finish(); } }设置APP启动的第一个Activity为SplashActivity
android:name=".ui.activity.SplashActivity" android:theme="@style/SplashTheme"style
目的是为了消除点开应用是的白屏
解决
1: 设置windowBackground为logo或者其他图片
<style name="SplashTheme" parent="AppTheme"> <item name="android:windowBackground">@drawable/bg_home</item> </style>2:设置背景为透明色
<style name="SplashTheme" parent="android:Theme.Translucent.NoTitleBar.Fullscreen"> </style>
总结:其实就是欺骗了眼睛,看起来秒开。
注:个人笔记
本文介绍了一种通过设置启动Activity来消除APP启动时白屏现象的方法,包括使用自定义主题将窗口背景设为特定图片或透明色,实现APP启动画面的无缝衔接。
8242

被折叠的 条评论
为什么被折叠?



