//Create a UIScrollView object and set its frame equal to the view's frame UIScrollView scrollView = new UIScrollView(View.Bounds); //Add the scrollView as a subview of the main view View.AddSubview(scrollView); //Set the contentSize of the scrollView to the size of the content scrollView.ContentSize = new CoreGraphics.CGSize(500, 1000);
//Create a UIImageView object and set its frame UIImageView imageView = new UIImageView(new CoreGraphics.CGRect(0, 0, 500, 1000)); //Set the image property of the imageView to an image UIImage image = UIImage.FromFile("myImage.jpg"); imageView.Image = image; //Add the imageView as a subview of the scrollView scrollView.AddSubview(imageView); //Set the contentSize of the scrollView to the size of the image scrollView.ContentSize = imageView.Frame.Size;Package/Library: UIKit framework (iOS)