Xamarin.Forms Android Flash image (for pure Android system)
1, under the Android.Resources.Drawable to add a good flash picture, named Splashpicture.
2. Create a new Splashscreen.xml file in Android.Resources.Drawable.
1<?xml version="1.0"encoding="Utf-8"?>2<bitmap xmlns:android="http://schemas.android.com/apk/res/android"3Android:src="@drawable/splashpicture"4android:gravity="Center|fill"5android:layout_gravity="Center"/>
View Code
3. Create a new values folder under Android.resources, and create a new Styles.xml file under this folder.
1<?xml version="1.0"encoding="Utf-8"?>2<resources>3<style name="Theme.splash"4Parent="Android:Theme.Holo.Light">5<item name="Android:windowbackground"> @drawable/splashscreen</item>6<item name="Android:windownotitle">true</item>7<item name="android:windowistranslucent">false</item>8<item name="android:windowisfloating">false</item>9<item name="android:backgrounddimenabled">true</item>Ten</style> One</resources>
View Code
4. Create a new SplashScreen class under Android
1[Activity (Label ="Test", Mainlauncher =true, nohistory =true, Theme ="@style/theme.splash",2Configurationchanges = Configchanges.screensize |configchanges.orientation)]3 Public classsplashscreen:activity4 {5 protected Override voidOnCreate (Bundle bundle)6 {7 Base. OnCreate (bundle);8 varIntent =NewIntent ( This,typeof(mainactivity));9 startactivity (intent);Ten Finish (); One } A}View Code
5. Remove the Mainlauncher = True from the MainActivity.cs file under Android.
1 " Test ", Windowsoftinputmode = Softinput.statehidden | Softinput.adjustpan, configurationchanges = Configchanges.screensize | configchanges.orientation)] 2
View Code
Over
xamarin.forms< four > Android login flash Map