Sportica   Sportica

UIPanGestureRecognizer

UIPanGestureRecognizer *recognizer = [[[UIPanGestureRecognizer alloc]initWithTarget:self
                                                                                 action:@selector(paningGestureReceive:)]autorelease];
    [recognizer delaysTouchesBegan];
    [self.view addGestureRecognizer:recognizer];


- (void)paningGestureReceive:(UIPanGestureRecognizer *)recoginzer
{
    NSLog(@"paniiii");
    if(self.navigationController.viewControllers.count <=1 )
    {
        return;
    }
    CGPoint point = [recoginzer translationInView:self.view];
    NSLog(@"%f,%f",point.x,point.y);

    if(recoginzer.state == UIGestureRecognizerStateBegan)
    {
       
    }
     self.view.frame = CGRectMake(point.x, point.y, self.view.frame.size.width, self.view.frame.size.height);
}

 

posted @ 2013-06-24 17:46  qingjoin  阅读(736)  评论(0编辑  收藏  举报
  Sportica