Rob L
Rob L

Reputation: 2372

Xamarin iOS - Background image does not fill page on iOS Tablets

I have an image that I use to fill the background on my log on page.

Android Phone - works OK

Android Tablet - works OK

iOS Phone - works OK

iOS Tablet - Does not extend all the way across (see image - dark green area to the right)

Code is simply:

<ContentPage
    ...
    BackgroundImageSource="GradientBackground.png">

Does anyone know how to fix or a workaround for this?

enter image description here

Upvotes: 0

Views: 639

Answers (1)

nevermore
nevermore

Reputation: 15816

But I am suffering from another error when I do... System.IO.FileNotFoundException: Could not find file...

Try to clean/rebuild your project. And then re-add the image.

If you put the image in the Xamarin.forms project as Embedded images, image needs to be set to Build Action: EmbeddedResource.

Have a try to set backgroundImage by yourself if you problem still exist by using BackgroundImageSource:

<ContentPage.Content>
        <Grid>

            <Image Source="BackGroundImage.jpg" 
                   Aspect="AspectFill"
                   />

            <!-- Place your layouts and controls here, for example-->

        </Grid>

</ContentPage.Content>

Upvotes: 1

Related Questions