Welcome to Xamarin Guy Show Blog

Keep updated for latest and Greatest Posts from Xamarin guy

Xamarin Forms Fast Splash Screen[Tutorial 29]

Hey guys in this tutorial we are going to add splash activity in xamarinforms Android project. We dont need fast splash scrreen for ios as it’s not required.
In this project we are going to work only with platform specific android project.
So Show me the Code for Android:
Step 1 : At First Create a new SplashActivity class inside Android project. Remember i am making an activity class not the simple Xamarin form class. In this Activity class we are going to set our mainlauncher as true so that splashactivity will be called first instead of main activity.

Step2:Now we have set our SplashActivity as first activity . Now our work is to disable the the main launcher to false in MainActivity

step3: For the android project we will have to add Styles.xml page in which we are going to create a theme as Theme.splash

Step3: Now We have to place the image inside the resources – drawable folder inside Android project.

That’s All If You are still getting error then implement Older Version implementation:

**** For Older Version of Xamarin Forms / PCL projects …
Note :

Step1: Inside Mainactivity.cs we are going to inherit from FormsApplicationActivity.

“public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity”
We have to then uncomment the two commands:

” TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;”
Step2: Then you should call this  parent=Theme.AppCompat.Light.NoActionBar” inside your styles.

Step 3: Similarly Your Splash Activity will took like this with no changes. We are going to make the main thread sleep for 500 ms till our Splash screen loads up.

Step4: It;s no needed to add this code if problem still exist try adding android:theme=@android:style/Theme.Translucent” code inside application tags inside AndroidManifest.

 2,325 total views,  1 views today

Leave a Reply