I was curious if there were a way I could use a common folder to hold all my icons and fonts? for now I am only building the android project so it's not been an issue, but I am getting close to working on the iOS port for it. I was hoping to be able to manage the images within the PCL project, but I gather that's not possible. I would prefer to have a common source for all of my icons rather than having to keep multiple copies in multiple locations. I know that the various platforms probably have different dimensional requirements, but I can just keep all of them in the same place so modifications to specific icons can be checked and reflected in the same location.
Cheers!
Answers
You can put your image or font in the PCL with
EmbeddedResource.
set image's Build Action: fromNone
toEmbeddedResource
. However I do not recommend to use this way, this way will affect your application's performance(like make I/O operation to read external file). The best way is put image separately(for android and iOS).https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/images?tabs=windows#embedded-images
Xamarin forums are migrating to a new home on Microsoft Q&A!
We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
For more information, please refer to this sticky post.
I figured it would be something like that, but it never hurts to make sure.
Thanks!
You are welcome, if reply is helpful, please click the
Yes
tab under the helpful answer. It will help others who have similar issue.