android启动时splash页出现白屏/黑屏

来源:互联网 发布:淘宝活动广场在哪 编辑:程序博客网 时间:2024/05/16 14:35

解决思路:把启动图设置为窗体背景,避免刚刚启动App的时候出现黑/白屏

解决方法:

设置style

<!-- 启动图style  把启动图设置为窗体背景,避免刚刚启动App的时候出现,黑/白屏 -->    <style name="ThemeSplash" parent="Theme.AppCompat.Light.NoActionBar">        <!--<item name="android:background">@drawable/img_bg_1</item>--><!--效果和windowBackground一样,但是会影响slpash页dialog的显示-->        <item name="android:windowBackground">@drawable/img_bg_1</item>        <item name="android:windowNoTitle">true</item>        <item name="android:windowFullscreen">true</item>        <item name="windowActionBar">false</item>        <item name="windowNoTitle">true</item>    </style>

使用

<activity android:name=".activity.SplashActivity"            android:theme="@style/ThemeSplash">...


阅读全文
1 0
原创粉丝点击