0

I want to organize my drawable folder by adding extra directories to keep images that should be grouped together all in one place. However, I can only seem to use an image if it is directly located inside the drawable folder.

For example, this works if nfc_frame_1.png is directly in the drawable folder.

var instructionAnimation = new Image
            {
                Source = ImageSource.FromFile("nfc_frame_1.png")
            };

but if I create an "animations" directory, then an "nfc" directory, and place the image in there, this reference seems to not work:

var instructionAnimation = new Image
            {
                Source = ImageSource.FromFile("animations/nfc/nfc_frame_1.png")
            };

I've tried with back slashes, forward slashes, referencing the image just by name even though it's inside those directories..nothing seems to work. Any ideas?

Will Nasby
  • 1,068
  • 2
  • 16
  • 39
  • It is basically *NO* to using drawable subdirectories. The Android SDK does not support it. While it is possible to support multiple top (root) resource directories, these would not work with `Image.FromFile`. – SushiHangover Aug 05 '16 at 16:24
  • You could however use an `Assets` folder with sub-directories if you wanted to go down this route instead. – Jon Douglas Aug 05 '16 at 16:32

0 Answers0