我正在使用Xamarin.Forms和.NET Standard开发一个应用程序,并通过在Android特定项目中编写代码来制作Android应用程序的闪屏。它能够工作,但是由于某些原因,闪屏的图像质量似乎比原始图像低。原始图像目前为150x150像素,我还尝试过将图像制作成不同大小,例如100x100像素和200x200像素,但问题仍然存在。 我是这样制作的:
I created a theme within the styles.xml file:
<style name="Theme.Splash" parent="android:Theme"> <item name="android:windowBackground">@drawable/splash_screen</item> <item name="android:windowNoTitle">true</item> </style>
Within the Drawable folder I created a file called splash_screen.xml (splash is an image within the drawable folder):
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <color android:color="@android:color/white"/> </item> <item> <bitmap android:src="@drawable/splash" android:tileMode="disabled" android:gravity="center"/> </item> </layer-list>
I coded an Activity in C# that consumes the Theme and is the MainLauncher for the application.
此外,我尝试下载Snapchat的APK文件,并使用那里的启动图像进行测试,因为当我在我的设备上打开该应用程序时,其启动屏幕的图像看起来高品质和清晰。然而,即使如此,在我的应用程序的启动屏幕中,质量也似乎较低。