Why Use Shared Images Over Native Approach?

D-BotD-Bot CAUniversity ✭✭

I've read through the various posts on accessing images using shared projects and PCL's and I'm trying to determine when or why I would want to use the shared image approach versus using the platform specific approach. For example, with iOS, we can take advantage of the naming conventions to load the correct resources for each device and resolution. I can get shared images working, but the moment you start having to use different resolutions and sizes for different devices, it seems to me that the work in loading the correct images outweighs using the shared approach in the first place. Any thoughts?

Posts

  • CraigDunnCraigDunn USXamarin Team Xamurai

    IM(H)O always use platform specific images for navigation & UI elements (which will be most of your embedded images, usually?). This enables you match resolution and color to the platform without too much effort in code (except for remembering to keep the image naming in sync). Same goes for backgrounds (match expected screen sizes), default avatar images and the like... I almost always want to tweak them for iOS vs Android vs WinPhone.

    For me, sharing a single image across all the platforms only makes sense for a small class of images, like textures or 9-patch pieces. But then, if you've got platform-specific images for everything else, I'd just go the same way with these. Shared images don't seem to offer a great deal of value to me. Love to hear other POV tho'.

  • D-BotD-Bot CAUniversity ✭✭

    I realized that if I write some code to map a resource based off device and resolution then it's actually quite nice to have the platform specific loading abstracted.

Sign In or Register to comment.