Xamarin形成自定义启动画面 [英] Xamarin forms custom splash screen
问题描述
在我的启动屏幕上,我想将适用于Android和iOS的应用程序版本放在底部
On my Splash screen, I want to put the App version for both Android and iOS at the bottom
推荐答案
通常,我们使用drawable资源创建初始屏幕.它无法输入文本,您可以使用您感兴趣的文本生成静态图像.
Normally, we use drawable resource to create the splash screen. It could not input the text, you could generate static images with the text you are interested in.
我们用来创建启动画面的方式.
The way we used to create the splash screen.
资源> Drawable>创建splash_background.xml
Resource> Drawable> Create splash_background.xml
<?xml version="1.0" encoding="utf-8" ?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<color android:color="#000000"/>
</item>
<item>
<bitmap
android:src="@drawable/pink"
android:tileMode="disabled"
android:gravity="center"/>
</item>
</layer-list>
资源>值>在styles.xml中添加样式
Resources> values> add style in styles.xml
<style name="MyTheme.Splash" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@drawable/splash_background</item>
</style>
在MainActivity中更改主题.
Change Theme in MainActivity.
[Activity(Label = "SplashScreenDemo", Icon = "@mipmap/icon", Theme = "@style/MyTheme.Splash", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
有关IOS的更多信息,您可以检查链接. https://medium.com/@thesultanster/xamarin-启动画面正确的方式3d206120726d
For more about IOS, you could check the link. https://medium.com/@thesultanster/xamarin-splash-screens-the-right-way-3d206120726d
这篇关于Xamarin形成自定义启动画面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!