Android App启动白屏 Android的App启动时白屏的问题解决办法

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

Android App启动白屏 Android的App启动时白屏的问题解决办法

王润_   2021-03-29 我要评论
想了解Android的App启动时白屏的问题解决办法的相关内容吗,王润_在本文为您仔细讲解Android App启动白屏的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:Android,App启动白屏,Android,App启动白屏的解决办法,Android,App启动白屏的问题,下面大家一起来学习吧。

Android的App启动时白屏的问题解决办法

在手机上调试后第一次启动后会等待很长时间白屏,

设置style样式,给activity加上设置的样式,完美解决

参考一下下面的代码.就可以解决(亲测好用)

<style name="SplashTheme" parent="AppBaseTheme">
  <!-- 将splash图片设置在这,这样这张图片取代白屏 -->
  <item name="android:windowBackground">@drawable/splash</item>
  <item name="android:windowFullscreen">true</item>
  <!-- 或者是将主题设置成透明,虽然点击图标会有点小小的卡顿,但是用户体验不影响 -->
  <!-- <item name="android:windowIsTranslucent">true</item> --> <!-- 透明背景不要了 -->
</style>
<!-- 然后将图片设置给启动Activity -->
 <activity android:name=".activity.SplashActivity"
      android:theme="@style/SplashTheme"
      android:screenOrientation="portrait">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>

以上就是对Android App启动白屏解决办法的实例详解,如有疑问请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

猜您喜欢

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们