Application and activity in the OnCreate are optimized, basically no time-consuming operation, but after starting the application will still flash a white background, and then into the splash page, compared to QQ, Weibo and other clients, After the click is instantaneous response Splash start page, where is the difference.
In fact, even if you oncreate do not do anything, will still flash white screen, because the initial parsing interface takes a certain amount of time, the solution is to customize the theme.
Customize the following
<style name= "Appsplash" parent= "Android:theme" > <item name= "Android:windowbackground" > @drawable/ ipod_bg</item> <item name= "Android:windownotitle" >true</item>
The configuration file is configured as follows
<activity android:theme= "@style/appsplash" android:name= ". Splashactivity "> </activity>
Start Page Call:
[Activity (Label = "", Theme = "@style/appsplash", Mainlauncher = True)] public class startupactivity:activity { protected override void OnCreate (Bundle savedinstancestate) { base. OnCreate (savedinstancestate); StartActivity (typeof (Loginactivity)); Overridependingtransition (Android.Resource.Animation.SlideInLeft, Android.Resource.Animation.SlideOutRight); Create your application Here } }
In this way, click on the app icon will immediately respond, the background image set up, with QQ, the same effect.
Xamarin.android Splash Page Instant Response _ Avoid app startup Flash white screen