博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
判断上下滚动
阅读量:7120 次
发布时间:2019-06-28

本文共 572 字,大约阅读时间需要 1 分钟。

hot3.png

uitableview 无需关联delegate 只需要再uitabviewcontrller 中添加上

UIScrollViewDelegate

int lastContentOffset;

-(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {

    lastContentOffset = scrollView.contentOffset.y;

}

-(void)scrollViewDidScroll:(UIScrollView *)scrollView {

    if (scrollView.contentOffset.y<lastContentOffset)

    {

        [self.navigationControllersetNavigationBarHidden:NOanimated:YES];

//向上

    } else if (scrollView.contentOffset.y>lastContentOffset)

    {

        [self.navigationControllersetNavigationBarHidden:YESanimated:YES];

//向下

    }

}

转载于:https://my.oschina.net/lewis180/blog/352278

你可能感兴趣的文章
【随想】关于图灵机
查看>>
echarts 通过ajax实现动态数据加载
查看>>
结构化方法与面向对象方法之比较
查看>>
Pig调试环境
查看>>
Python连接MySQL数据库
查看>>
BZOJ2815:[ZJOI2012]灾难(拓扑排序,LCA)
查看>>
[转] js对象监听实现
查看>>
【leetcode】714. Best Time to Buy and Sell Stock with Transaction Fee
查看>>
mongoDB 3.0 安全权限访问控制
查看>>
电子数字 网易游戏在线笔试 第一题 hihocoder
查看>>
Java 中nextLine()方法没有执行直接跳过解决办法
查看>>
重写和重载
查看>>
本表收录的字符的Unicode编码范围为19968至40869
查看>>
PHP多次调用Mysql存储过程报错解决办法
查看>>
leetcode-680-Valid Palindrome II
查看>>
php用curl获取远端网页内容
查看>>
selenium+python谷歌驱动配置
查看>>
oralce的function处理考勤时间节点以及计算工作时间
查看>>
(三)、一步一步学GTK+之布局
查看>>
43. ExtJs控件属性配置详细
查看>>