我想讓我的Monotouch應用程序中的UIScrollView工作。無論我將SetZoomScale()設置爲它總是忽略我的起始比例。理想情況下,當我啓動時,我想讓它變爲0.5f變焦。UIScrollView不從最小變焦開始
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; };
有誰能告訴我我哪裏出錯了。
非常感謝。
+1當我輸入我的回覆時回答! :d – cod3monk3y