Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Create FileImageSource from an iOS Asset Catalog Image Set

$
0
0

Today I got stuck on a thing I didn't expect to get stuck on: loading an image from Asset Catalog Image Set into Page.Icon property.

I've placed my icon under /Resources/Images.xcassets/Card.imageset using Xamarin Studio Asset Editor. This icon is being displayed fine when working with, say, ImageCell. According to the documentation, when I write imageCell.IconSource = "Card"; an implicit conversion to UriImageSource is performed, and it all works as expected.

But when I write page.Icon = "Card" an implicit conversion to FileImageSource is done, and FileImageSource doesn't seem to be able to deal with Asset Catalog Image Sets.

Is there any way to fix this other than ditching Asset Catalog Image Sets altogether?

Thanks.


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>