UIScrollView myScrollView = new UIScrollView(new CGRect(0, 0, 320, 568)); UIImageView imageView1 = new UIImageView(new CGRect(0, 0, 320, 568)); UIImageView imageView2 = new UIImageView(new CGRect(0, 568, 320, 568)); myScrollView.AddSubviews(new UIView[] { imageView1, imageView2 });
UIScrollView myScrollView = new UIScrollView(new CGRect(0, 0, 320, 568)); UILabel label1 = new UILabel(new CGRect(10, 10, 300, 50)); label1.Text = "Label 1"; UILabel label2 = new UILabel(new CGRect(10, 70, 300, 50)); label2.Text = "Label 2"; myScrollView.AddSubviews(new UIView[] { label1, label2 });In this example, we create a UIScrollView instance and 2 UILabel instances, each with its own frame and text. We add both labels as subviews to the scroll view. Package/Library: Xamarin.iOS or Xamarin.Forms In general, the UIScrollView class is part of the iOS SDK and can be used in C# through the Xamarin.iOS or Xamarin.Forms libraries.