2017-12-01  本文已影响81人  傲骨天成科技

1.找到是向上拖动还是向下拖动
-(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
_startSlidingY = scrollView.contentOffset.y;
_firstRun=NO;
}
-(void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (scrollView.contentOffset.y<_startSlidingY) {
//下
_upSliding=NO;
} else {
//上
_upSliding=YES;
}
_startSlidingY = scrollView.contentOffset.y;
}

2.在视图将显示的时候改变视图的层级即可

上一篇下一篇

猜你喜欢

热点阅读