当我的手指在屏幕上上下移动时,我有 3 个 UIViews 会改变它们的高度,每个都像这样:
- (void)pan:(UIPanGestureRecognizer *)aPan; {
CGPoint currentPoint = [aPan locationInView:self.view];
currentPoint.y -= 80;
if (currentPoint.y < 0) {
currentPoint.y = 0;
}
else if (currentPoint.y > 240) {
currentPoint.y = 240;
}
currentPoint.y = 240.0 - currentPoint.y;
[UIView animateWithDuration:0.01f
animations:^{
CGRect oldFrame = secondBar.frame;
secondBar.frame = CGRectMake(oldFrame.origin.x, (oldFrame.origin.y - (currentPoint.y - secondBar.frame.size.height)), oldFrame.size.width, (currentPoint.y));
}];
}
但是,在屏幕上移动我的手指会移动所有三个视图。如何更改它,以便当我的手指在屏幕的某个部分/特定视图上时,它只会移动该视图?