我有一个与macOS底座类似的视图-可以将其完全移出屏幕。
我的手势识别器看起来像:
-(void)swipeDown:(UISwipeGestureRecognizer *)sender
{
NSLog(@"Swipe Down");
// this should move the dock 10 pixels below the bottom of the screen
[UIView animatewithduration:0.5
delay:0.0
options:UIViewAnimationOptionCurveEaseOut
animations:^{[self dockView].frame = CGRectMake(kSafeMarginHorizontal,self.view.frame.size.height + 10,self.view.frame.size.width - (kSafeMarginHorizontal * 2),80);}
completion:nil];
}
我仅在固定了左右边缘的ockView上使用自动调整大小蒙版。在我的主要父视图中,我致电:
[[self view] setTranslatesAutoresizingMaskintoConstraints:YES];
这可以正常工作,但是在滑出屏幕后,相应的“向上滑动”手势不再起作用,如果再次向下滑动,我将不再获得表示已调用该方法的NSLog。
我可以通过不将视图完全滑出屏幕来防止这种情况。如果我在屏幕上至少留下了几个像素,它将继续正常工作。
为什么这会打断我的手势识别器?