。。。。。。 (Empty talk, less)
Xamarin developed a few technical materials, through learning, their own learning process and the problems encountered in sharing with you.
Splash screen is a picture that appears when the app is launched, and the General app's Splash screen is a dynamic advertising message.
Learn how to load a fixed splash screen first.
First, add code in Resource/values/styles.xml.
<?xml version= "1.0" encoding= "UTF-8"?><resources> <style name= "theme.splashactivity" parent= " Android:Theme.Holo.Light.NoActionBar "> <item name=" Android:windowbackground "> @drawable/ic_splash_ Logo</item> </style></resources>
The Android:windowbackground is set to the picture to be loaded.
Second, create a splashactivity class file, the code is as follows:
namespace myapplication{ using System.Threading; Using Android.app; Using Android.os; [Activity (Label = "SplashScreen", Mainlauncher=true, Nohistory=true, theme= "@style/theme.splashactivity")] public class splashactivity:activity { protected override void OnCreate (bundle bundle) { base. OnCreate (bundle); Set thread wait thread.sleep (+); Start mainactivity startactivity (typeof (Mainactivity));}}
Parameter description:
1.MainLauncher: Indicates that the activity is a startup activity and is automatically started from this page when the application starts.
2.theme-the custom style file.
3.nohistory-By default, you can move from one activity to the next and back to the previous one from the next. This reason,
We are here splash screen and do not need to return from one to the previous, so its function is not to record historical operations.
Note: The Mainlauncher property cannot be set in Mainactivity, and if set, it will be two app packages at the time of installation.
Xamarin Android-Create splash screen (one)