我是xcode和objective c的新手,我想知道如何使用轻击手势使图像全屏触摸... 任何人都可以帮助我?如何在iOS应用程序中使图像变成全屏应用程序
这里是我试过的代码:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
tap.numberOfTapsRequired = 1;
tap.cancelsTouchesInView = NO;
imageView.userInteractionEnabled = YES;
[imageView addGestureRecognizer:tap];
}
-(void)handleTap{
imageView.frame=CGRectMake(0,0,320,480);
}
检查:-http://stackoverflow.com/questions/9008975/how-to-tap-to-zoom-and-double-tap-to-zoom-out-with-uiscrollview –
不忘记imageView.contentMode = UIViewContentModeScaleToFill; –