【发布时间】:2019-04-30 14:25:01
【问题描述】:
我的可绘制文件夹中有图像,我将它们调整为标准尺寸并将它们放在每个文件夹中。但是当我启动我的应用程序并且 MainActivity 运行时,我的 SplashScreen 图像出现拉伸并且在屏幕上看起来很糟糕。我在网上看了答案,没有任何效果。
如何使图像在启动画面上看起来正常。
这是我的 MainActivity.cs
[Activity(Label = "Peppy", Icon = "@mipmap/bicon", Theme = "@style/peppy", MainLauncher = true, NoHistory = true)]
public class SplashActivity : Activity
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
StartActivity(typeof(MainActivity));
}
}
这就是我在 style.xml 中定义我的风格的方式
<style name="peppy" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@drawable/bluesplash</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:colorPrimaryDark">#1976D2</item>
</style>
<style name="Main Theme" parent="MainTheme.Base"></style>
我希望 SplashScreen 图像完全适合我想要的屏幕。谢谢
【问题讨论】:
标签: xml xamarin.forms splash-screen