I have problem with my splash screen on Android. Splash screen is displayed to the user during long application startup but activity background is always black. I mean background bitmap (splash image) is visible, but background is black instead of white. I'm using PNG image with transparency.
What I have:
- PNG splash screen image with transparent background
- Splash screen activity
[Activity(MainLauncher = true, Theme = "@style/Theme.Splash", NoHistory = true)]
public class SplashScreen : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Do your app initialization here
// Other long running stuff
// Run app when done
StartActivity(typeof(MainForm));
}
}
- Theme style for splash screen activity in resources/values/styles.xml
<resources>
<style name="Theme.Splash" parent="@android:style/Theme.Holo.Light">
<item name="android:windowBackground">@drawable/splash_centered</item>
<item name="android:windowNoTitle">true</item>
</style>
</resources>
- Splash drawable in resources/drawable/splash_centered.xml
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/splash"
android:gravity="center"
android:background="@color/white"> <!-- this is ignored -->
Problem: As you can see, I'm using Theme.Holo.Light as parent theme and I'm using it in the rest of my app. Holo light is using white background. This white background is not applied on SplashActivity background. SplashActivity background is always black. Background bitmap (splash image) is visible, but background is black instead of white. I'm using PNG image with transparency.
Question: How to set default Holo.Light theme background color (white) on the SplashScreen activity?
Note: I'm using Xamarin.Android, but styling is common for Android platform. Android version 4 and above.