Hello all.
I am currently creating an App in Xamarin forms to be cross compatible with iOS and Android. I have an image that I want to be as teh background for the app.
Per all of the MS tutorials, in the Android project, I added the image to the drawable folder. For the iOS, I added the image to the Assets catalog using an image set. I placed the image in the 1x slot.
Now, my page is setup like this:
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
this.BackgroundImageSource = (Device.RuntimePlatform == Device.Android) ? ImageSource.FromFile("SADBackground.png") : ImageSource.FromFile("BackgroundSAD");
}
}
In Android, everything loads fine. I see the background image. In iOS, I get a white page. Nothing. I have tried many different things and I am unable to get the image to appear in iOS.
So my question is, what is the correct way to reference an image for it to work in iOS? Currently, the image name is SADBackground.png while the Image Set name is BackgroundSAD. Not sure if this matters. I did try it so that the image set name and picture name are the same however, that did not work.
I should also note that the images resolution is 1440x2880
Edit:
I have also decreased the image resolution to match the screen resolution of the iPhone 8 again, no image is being displayed. This is ridiculous.