zoukankan      html  css  js  c++  java
  • iOS之滑动隐藏导航

    滑动隐藏导航狼栏

    -(void)scrollViewDidScroll:(UIScrollView *)scrollView{
        CGFloat offsetY = scrollView.contentOffset.y + _tableView.contentInset.top;
        CGFloat panTranslationY = [scrollView.panGestureRecognizer translationInView:self.tableView].y;
        if (offsetY > 64) {
            if (panTranslationY > 0) {
                //下滑趋势,显示
                [self.navigationController setNavigationBarHidden:NO animated:YES];
            }else{
                //上滑趋势,隐藏
                [self.navigationController setNavigationBarHidden:YES animated:YES];
            }
        }else{
            [self.navigationController setNavigationBarHidden:NO animated:YES];
        }
    }
  • 相关阅读:
    第三天-基本数据类型 int bool str
    第二天-while循环 格式化输出 运算符 编码
    第一天-python基础
    Mysql
    Mysql
    Mysql
    Mysql
    Mysql
    Mysql
    Php
  • 原文地址:https://www.cnblogs.com/YaoJinye/p/5908747.html
Copyright © 2011-2022 走看看