Issue
I am trying to display a local image in my Xamarin.Forms app, but for some reason I can not see it. I saved hawk.jpg under Assets/ in the core project and in the Android project under Ressource/Drawable/Assets.
This is how I try to display the image
new Image
{
Source = "Assets/hawk.jpg",
Aspect = Xamarin.Forms.Aspect.AspectFill,
WidthRequest = 200,
HeightRequest = 200
}
Solution
Remove Assets/ from the source. This should resolve your issue. Also make sure the image is marked as a resource in your Xamarin project (right click the image and it will be under the file type).
Answered By - Reedy
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.