发布于 2017-09-12 08:16:21 | 196 次阅读 | 评论: 0 | 来源: 网友投递
Android移动端操作系统
Android是一种基于Linux的自由及开放源代码的操作系统,主要使用于移动设备,如智能手机和平板电脑,由Google公司和开放手机联盟领导及开发。尚未有统一中文名称,中国大陆地区较多人使用“安卓”或“安致”。
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启动白屏解决办法的实例详解,如有疑问请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!