我有一个UIView
在点击它后缩放到 4 倍的。它工作正常。在下一次点击时,我想将其恢复为原始大小。问题是它只UIView
在缩放之前的较小矩形中识别水龙头。我想在缩放的任何地方识别水龙头UIView
。我怎样才能实现它?
//Tapping code
titleCard = [[UIView alloc] initWithFrame: myrect];
[self addSubview:titleCard];
[titleCard release];
UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(changeSize:)];
[tapRecognizer setNumberOfTouchesRequired:1];
[tapRecognizer setNumberOfTapsRequired:1];
[titleCard addGestureRecognizer:tapRecognizer];
[tapRecognizer release];
//Scaling code
CABasicAnimation *scale = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
[scale setBeginTime:CACurrentMediaTime()+0.75];
[scale setDuration:0.5];
[scale setToValue: [NSNumber numberWithFloat:4.0f]];
[scale setRemovedOnCompletion:NO];
[scale setFillMode:kCAFillModeForwards];
谢谢。