我试图让 UIScrollView 在我的 Monotouch 应用程序中工作。无论我将 SetZoomScale() 设置为什么,它总是忽略我的起始比率。理想情况下,我希望它在启动时进行 0.5f 缩放。
theGraphScrollView = new UIScrollView(theRect); // Half of the screen height, full width of screen
this.View.AddSubview(theGraphScrollView);
UIImageView imageView = new UIImageView(thePhotoSource.LoadPhotoFromFile("IMG_0_17.JPG"));
theGraphScrollView.ContentSize = imageView.Image.Size; // This is much bigger than the screen width and height.
theGraphScrollView.MaximumZoomScale = 3f;
theGraphScrollView.MinimumZoomScale = 0.5f;
theGraphScrollView.SetZoomScale(0.5f, true);
theGraphScrollView.AddSubview(imageView);
theGraphScrollView.ViewForZoomingInScrollView += (UIScrollView sv) => { return imageView; };
谁能告诉我哪里出错了。
非常感谢。