您的位置:首页 > 移动开发 > IOS开发

iOS 视图滚动到某一个位置做某一件事

2013-10-17 14:39 344 查看
#pragma UIScrollView
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ([[UIDevice
currentDevice] userInterfaceIdiom] ==
UIUserInterfaceIdiomPhone) {
return (interfaceOrientation !=
UIInterfaceOrientationPortraitUpsideDown);
} else {
return
YES;
}
}

//隐藏导航栏的方法
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{

NSLog(@"scrollViewDidScroll---->%f",self.myTableView.contentOffset.y);

if (self.myTableView.contentOffset.y >=
171)
{
self.addNavBar.hidden =
YES;
NSLog(@"隐藏导航栏");
}
if (self.myTableView.contentOffset.y <=
171) {

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: