-1
我有一个60的高度,我已经放置tableview在y = 60.我想要当我滚动表我的upperview应该隐藏,当我向下滚动它应该可见again.But我不能让这个upperview作为tableview的标题。请帮助我如何检测tableview中的scrollview的方向,它是向上或向下移动。隐藏视图只是在桌面上
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
int scrollPosition = scrollView.contentOffset.y;
if(upperview.frame.size.height<scrollPosition>1 && moveDirection = movingup){
//code to make hide
}else if(upperview.frame.size.height==scrollPosition>1 && moveDirection = movingDown){
//code to show again
}
// But i have no idea how can i get this direction moveDirection = movingup or moveDirection = movingDown
}
感谢
为什么你不能让tableview的'upperview'标题?这就是它的目的! – Mischa
使您的upperview作为您的tableview标题视图。 –