我需要在我的应用程序中实现这个objective-c委托回调:
-(UIView *) viewForZoomingInScrollView:(UIScrollView *)inScroll {
return imageView;
}
但是我使用 MonoTouch 来开发我的应用程序,如何在 MonoTouch 中实现委托?(我知道关于“在 MonoTouch 中实现代表”我可能没有使用正确的术语,请告知)。
这是我需要委托回调的代码(我需要滚动视图中的图像视图是可缩放的):
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
Loader loader = new Loader("/Users/jacknutkins/Documents/ARCSDev");
loader.LoadChart("2");
CGBitmapContext context = loader.GetHiResImage(loader.PaletteFile.RGBPaletteDay);
UIImage image = UIImage.FromImage(context.ToImage());
this.View.BackgroundColor = UIColor.Red;
RectangleF rect = new RectangleF(0.0f, 0.0f, image.Size.Width, image.Size.Height);
//RectangleF rect = new RectangleF(scrollView.Frame.Location, scrollView.Frame.Size);
UIImageView imageView = new UIImageView(rect);
imageView.Image = image;
scrollView.ContentSize = image.Size;
scrollView.AddSubview(imageView);
scrollView.ClipsToBounds = true;
scrollView.SetZoomScale(0.5f, true);
Console.WriteLine("View Did Load Done.");
// Perform any additional setup after loading the view, typically from a nib.
}
泰辛