Common folders for Image and font assets? RRS feed

  • Question

  • User387004 posted

    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.


    Wednesday, February 10, 2021 6:31 AM

All replies

  • User379860 posted

    You can put your image or font in the PCL with EmbeddedResource. set image's Build Action: from None to EmbeddedResource. 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).


    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.

    Wednesday, February 10, 2021 10:42 AM
  • User387004 posted

    I figured it would be something like that, but it never hurts to make sure. Thanks!

    Wednesday, February 10, 2021 5:45 PM
  • User379860 posted

    You are welcome, if reply is helpful, please click the Yes tab under the helpful answer. It will help others who have similar issue.

    Thursday, February 11, 2021 2:11 AM