Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am creating welcome screen in Xamarin shared application.Welcome screen has to show the image few seconds then navigate to login page.It is perfectly working in IOS, but not displaying image in Android.

 public Page()
    {


        //var beachImage = new Image { Aspect = Aspect.AspectFit };
        //beachImage.Source = ImageSource.FromFile("nextera.png");
        Image logo = new Image { WidthRequest = 800, HeightRequest = 800 };
        logo.Source = ImageSource.FromFile("nextera.png");
        logo.Aspect = Aspect.AspectFit;
        Content = new StackLayout
        {
            Children = { logo },
            Padding = new Thickness(0, 20, 0, 0),
            VerticalOptions = LayoutOptions.StartAndExpand,
            HorizontalOptions = LayoutOptions.CenterAndExpand

        };
        WaitAndExecute(2000);

    }

    private async Task WaitAndExecute(int milisec)
    {
        await Task.Delay(milisec);
        await Navigation.PushAsync(new Login());
    }
share|improve this question

1 Answer 1

You need to add to the android project the file nextera.png to

Resources/drawable

 directory with Build Action: AndroidResource

A full guide for adding an image - Xamarin official guideline for loading a local image

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.