vidyasagar85
vidyasagar85

Reputation: 131

Window Phone8:Black screen after splash screen

I have been facing this issue for quite a long time now.The problem is that i am getting the blackscreen after my app loads the SplashScreenImage.jpg.The blackscreen remaims for 4 to 5 seconds and then my app loads the landing page.

i tried using some plugin for splashscreen Also used the navigator.splashscreen.show() and hide methods of the plugin but was unable to achieve any success.

Upvotes: 0

Views: 1092

Answers (3)

Anmol Kumar
Anmol Kumar

Reputation: 90

Here's what you can do if you're using the SplashScreen just for the branding purpose.

Create a new page.

Set the SplashScreen Image as the background image of this page.

On the Load Event, say LayoutRoot Load Event, add some delay

After the delay time is over Navigate to your MainPage.

The code is somewhat like:-

    using System.Threading.Tasks;  //add the namespace
    private async void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
    {
        await Task.Delay(4000);   //add the delay
        NavigationService.Navigate(new Uri("/StartingPage.xaml"));  //navigate to your starting page
    }

Upvotes: 0

vidyasagar85
vidyasagar85

Reputation: 131

I literally searched for more than two days about getting this black-screen issue resolved. Finally after not getting any proper solution from the web i decided to dig in the issue and solve it.

So here is the solution

just add the following lines to your MainPage.xaml

    <Image HorizontalAlignment="Center" VerticalAlignment="Center" Source="yoursplashimage.jpg"/>

So now your MainPage.xaml should some what look like following

<phone:PhoneApplicationPage 
x:Class="yourappsnamespace.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
Background="Black"
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
shell:SystemTray.IsVisible="True" d:DesignHeight="768" d:DesignWidth="480" 
xmlns:my="clr-namespace:WPCordovaClassLib">
<Grid x:Name="LayoutRoot" Background="Transparent" HorizontalAlignment="Stretch">
    <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Image HorizontalAlignment="Center" VerticalAlignment="Center" Source="yoursplashimage.jpg"/>
    <my:CordovaView HorizontalAlignment="Stretch" 
               Margin="0,0,0,0"  
               x:Name="CordovaView" 
               VerticalAlignment="Stretch" />
</Grid>

</phone:PhoneApplicationPage>

That's it.Now you will get rid of the dumb blackscreen. One more thing just remove the SplashScreenImage.jpg from the root folder to avoid flickering of images(Note: Its ok if you don't remove the SplashScreenImage.jpg it depends upon once choice)

Upvotes: 1

Kulasangar
Kulasangar

Reputation: 9444

I don't think you could remove or reduce the time of that black screen appearing right after the Splashscreen. But you could try making your app more faster which could ideally load your app quicker. Ways to Load Applications Faster

Reference: How to make a windows phone application load faster like default applications?

Upvotes: 0

Related Questions