I’m trying to display a photo as a background on stacklayout.
I create a folder in the iOS project under Resources (The strange thing is that the folder is not visible in Solution Explorer but is seen through Finder /on my Mac/)
I put a name for the folder
Imagesand inside I put a picture with the name
Inside into my stacklayout I put this code:
<StackLayout> <Image Source="Images/Scattering.jpg" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" > </Image></StackLayout>
But the image does not appear.
I will attach a screenshot from my solution explorer and the finder on my mac.
Right click on the Solution -> Display Options -> Show All Files
Browse to iOS Resource folder and include Images folder (Right click, Include In Project)
Then, Right click on the image and make sure “Build Action” is BundleResource.
Set WithRequest and HeightRequest for the image to verify it’s appearing.