1

我有一个具有三个屏幕的应用程序,当用户从 ipad 屏幕底部向上滑动时,我想显示和隐藏一个小的 uiview。我知道这不能通过正常的滑动手势来解决。我想知道你能否告诉我如何处理这些滑动手势?

4

1 回答 1

5

将 UIPanGestureRecognizer 添加到您的视图中。

-(void) panDetected:(UIGestureRecognizer *) gesture 
{    
    BOOL fromBottom = NO;
    CGPoint loc = [gesture locationInView:self.view];

    if(gesture.state == UIGestureRecognizerStateBegan)
    {                  
       if(loc is somewhere in the bottom of view)
            fromBottom = YES;
    }
    else if(gesture.state == UIGestureRecognizerStateChanged)
    {
        // You can up your view with finger movement here


    }
    else if(gesture.state == UIGestureRecognizerStateEnded)
    {

    }
}
于 2012-07-08T20:32:21.837 回答