如何在iPad中放大/缩小图像?

| 我想在ipad应用程序中自动放大和缩小图像。例如,在初始屏幕中,它应该以原始尺寸显示图像,并且一段时间后,它应该开始自动缩小。这将使其具有动画放大/缩小外观。 我们如何使用iPad中的UIImageView做到这一点? 先感谢您。 ScrollImageController.h
@interface ScrollImageViewController : UIViewController  {

} @end

ScrollImageController.m
- (void)viewDidLoad
{

[super viewDidLoad];
UIScrollView *scrollView = [[UIScrollView alloc]   initWithFrame:self.view.frame];
scrollView.contentSize = CGSizeMake(847, 800);
UIImage *image = [UIImage imageNamed:@\"just.jpg\"];
UIImageView *imageView = [[UIImageView alloc] initWithImage: image];
[image release];
[scrollView addSubview:imageView];
[imageView release];
[self.view addSubview:scrollView];


[scrollView setZoomScale:2.0 animated: YES];
[scrollView release];
}     
已邀请:
        您应该使UIImageView成为UIScrollView的子视图 然后使用UIScrollViewDelegate将该类设置为您的类,然后使用以下方法。
    [MyScrollView setZoomScale:(float)scale animated:YES];
编辑:我不认为您需要实现UIScrollViewDelegate协议     

要回复问题请先登录注册