当前位置: 移动技术网 > IT编程>开发语言>Java > 解决App启动之前的白屏问题

解决App启动之前的白屏问题

2020年07月17日  | 移动技术网IT编程  | 我要评论

本来想在项目中加一个启动时的闪屏效果,结果发现闪屏效果有了,但是却使在App初始化的白屏之后才有闪屏,用户体验很差,看起来也不美观。
1.在网上搜了一下
网上我觉得解决很好的方案
2.如果报错:Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
是需要在onCreate()方法中将Theme装换成原来的AppTheme:

@Override
protected void onCreate(Bundle savedInstanceState) {
    setTheme(R.style.AppTheme);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    initView();
    initListener();
}

本文地址:https://blog.csdn.net/weixin_45219242/article/details/107377617

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网