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 Images
and inside I put a picture with the name Scattering.jpg
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.