Reputation: 1213
I tried solutions from the following links but none worked.
where-to-put-images-for-xamarin-froms-application
developer.xamarin.com/guides/xamarin-forms/user-interface/images/#Local_Images
image-not-showing-in-xamarin-forms-app.html
I used below syntax
<Image Source="lock.png" HeightRequest="20" WidthRequest="20" HorizontalOptions="Center" VerticalOptions="Center" Grid.Row="0" Grid.Column="0"></Image>
Here is the image for where i've kept image
No image displays
Edit
These are the only things in my XAML page.
Upvotes: 2
Views: 317
Reputation: 458
In my case I need to use method Forms.Init(Context activity, Bundle bundle)
, in my SplashScreen
OnCreate
method and Activity
class OnCreate
method. But it also important that images build action
properties is set on AndroidResource
.
Upvotes: 0
Reputation: 1213
In my case the issue was of assembly
.
when trying all the possible solutions like
1.) Changing Build Action
2.) Adding Image to all the folders within Resources
3.) Naming Convention should not include -
in File/Image Name.
4.) Changing Background Color
I also got one solution while searching for embedded Images that assembly
was missing here.
This change worked for me in using Local Images. Got that solution from this link
Upvotes: 3
Reputation: 955
Right click the lock.png image and see if there is an option "include in project"
If there is, project cannot find image
Upvotes: 0