博客> 实现view的下滑隐藏 上滑弹出
实现view的下滑隐藏 上滑弹出
2017-09-22 03:28 评论:0 阅读:240 杨雨帆

/ 滑动时方法 / //判断滑动方向

  • (void)scrollViewDidScroll:(UIScrollView *)scrollView{ static float newx = 0; static float oldx = 0; newx= self.webView.scrollView.contentOffset.y ; if (newx != oldx ) { if (newx > oldx) { [UIView animateWithDuration:.5 animations:^{ // self.tabBarController.tabBar.hidden = YES; self.orderView.frame = CGRectMake(0, RRPHeight, RRPWidth, 49); }];

    }else if(newx < oldx){
        [UIView animateWithDuration:.5 animations:^{

    // self.tabBarController.tabBar.hidden = NO; self.orderView.frame = CGRectMake(0, RRPHeight-49, RRPWidth, 49);

        }];
    
    }
    oldx = newx;

    } }

收藏
0
sina weixin mail 回到顶部