Cross Platform
Android
iOS
Test Cloud

Load an Image

This recipe shows how to load and display an image.

Recipe

To display an image:

  1. Add the image to your Xamarin.iOS project and ensure the Build Action is set to Content.
  2. Create a UIImageView and add the image using UIImage.FromBundle:
var imageView = new UIImageView (UIImage.FromBundle("MonkeySFO.png"));
imageView.Frame = new RectangleF (10,10,imageView.Image.CGImage.Width, imageView.Image.CGImage.Height);