问题
I have 4 Images in my Resources Directory into my Portable Project and i would like to use them directly for an ImageSource (because i need to bind it).
ImageSource myImageSource = ImageSource.FromResource("resources.image.png");
I tried this but it doesn't recognize the path. How can i use my images for an ImageSource ?
回答1:
Ok, my bad i forgot the name of my project before the Resources directory
ImageSource myImageSource = ImageSource.FromResource("NameOfProject.Resources.image.png");
来源:https://stackoverflow.com/questions/35941437/xamarin-forms-how-to-use-embedded-resources-in-pcl-project-for-image