我是 xcode 和目标 c 的新手,我想知道如何使用轻按手势使图像在触摸时全屏显示...有人可以帮助我吗?
这是我尝试过的代码:
- (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);
}