iphone UIScrollView缩放

allImageScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 768, 1024)];
allImageScrollView.minimumZoomScale = 0.3;
allImageScrollView.maximumZoomScale = 1.0;
allImageScrollView.backgroundColor = [UIColor clearColor];
allImageScrollView.delegate = self;
[self.view addSubview:allImageScrollView];

mPicStatusesViewController = [[PicStatusesViewController alloc] init];
[allImageScrollView addSubview:mPicStatusesViewController.view];

//UIScrollView Delegete 实现

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView

{
    return mPicStatusesViewController.view; //返回ScrollView上添加的需要缩放的视图
}

- (void)scrollViewDidZoom:(UIScrollView *)scrollView

{
    //缩放操作中被调用
}

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale

{
    //缩放结束后被调用
  }

原文地址:http://ios-iphone.diandian.com/post/2011-09-15/5066984

上一篇:.Net Framework 4.0 内部排序探索


下一篇:C# 多线程join的用法,等待多个子线程结束后再执行主线程