我有一个与以下主题有关的大屏幕活动:
<style name="AppTheme.Launcher" parent="Theme.AppCompat.NoActionBar">
<item name="android:background">@drawable/splash_theme</item>
</style>这是我的清单的一部分:
<activity
android:name=".activities.SplashActivity"
android:theme="@style/AppTheme.Launcher">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>这是我的抽屉:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
android:opacity="opaque">
<item android:drawable="@color/colorPrimaryDarkBackground" />
<item>
<bitmap
android:gravity="center"
android:src="@drawable/shelpwelt_theme" />
</item>
</layer-list>在一些构建,所有的工作完美,但有时飞溅屏幕是完全扭曲和模糊,但只是在前2-3秒。然后,当我的启动屏幕活动到达onCreate时,主题看起来非常好。
以下是问题所在:

发布于 2019-03-06 13:58:51
将bottom、left、right、top大小添加到项目中。
将您的可拖文件更改为:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
android:opacity="opaque">
<item android:drawable="@color/colorPrimaryDarkBackground" />
<item
android:bottom="24dp"
android:left="24dp"
android:right="24dp"
android:top="24dp"
>
<bitmap
android:gravity="center"
android:src="@drawable/shelpwelt_theme" />
</item>
</layer-list>发布于 2019-03-06 13:58:15
在本例中,您使用的是gif文件。在给定的时间后,你说,2-3秒,它包裹屏幕大小,所以图像变大。所以它在屏幕上变得模糊了。
发布于 2019-03-06 13:59:30
这可能是一个缩放问题,尝试更改splash的布局,而不是设计整个图像并将其设置为背景,设计您的布局要有两个图像,一个用于灰度矩形,另一个用于视频图标。
https://stackoverflow.com/questions/55024716
复制相似问题