向tab.scrollView添加右滑动手势识别器

时间:2014-07-30 03:17:54

标签: ios uiview gestures

我试图向showweb视图添加一个向右滑动的手势,但是却出现了错误,它没有认出来......这里是原始代码。我希望用户向右滑动并通过向下滑动显示网络视图,将其带到他们已经通过平移手势获得的输入视图。

- (void)showWeb
{
    [self.omnibar resignFirstResponder];

    Tab *tab = self.tabs[self.currentTabIndex];
    tab.userInteractionEnabled = YES;


//    tab.scrollView.panGestureRecognizer.enabled = YES;
    tab.scrollView.panGestureRecognizer.enabled = YES;

    [UIView animateWithDuration:.4 animations:^{
//        tab.transform = CGAffineTransformMakeTranslation(0, -showOffset);
        tab.transform = CGAffineTransformMakeTranslation(tab.transform.tx, tab.transform.ty-showOffset) ;
    }];

    [[UIApplication sharedApplication]setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
    self.showingTools = false;


}

- (void)showTools
{
//    [self.omnibar becomeFirstResponder];

    Tab *tab = self.tabs[self.currentTabIndex];
    tab.userInteractionEnabled = NO;
//    tab.scrollView.panGestureRecognizer.enabled = NO;
    [UIView animateWithDuration:.3 animations:^{
//        tab.transform = CGAffineTransformMakeTranslation(0, 0);
        tab.transform = CGAffineTransformMakeTranslation(tab.transform.tx, tab.transform.ty+showOffset);
    }];

    [[UIApplication sharedApplication]setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
    self.showingTools = true;

    if (newTabAlpha==1 || tab.request)
    {
        [self updateScreenshotOf:tab];
        [self.omnibar becomeFirstResponder];
    }
}

0 个答案:

没有答案