tabBarController隐藏和显示
- (void)scrollViewDidScroll:(UIScrollView *)scrollView1
{
if (!isRefresh) {
CGPoint offset = scrollView1.contentOffset;
CGRect bounds = scrollView1.bounds;
CGSize size = scrollView1.contentSize;
UIEdgeInsets inset = scrollView1.contentInset;
CGFloat currentOffset = offset.y + bounds.size.height - inset.bottom;
CGFloat maximumOffset = size.height;
//当currentOffset与maximumOffset的值相等时,说明scrollview已经滑到底部了。也可以根据这两个值的差来让他做点其他的什么事情
if((maximumOffset-currentOffset)<40.0)
{
NSLog(@"-----刷新数据-----");
currentPage++;
[self DataLoad];
}
}
}
//当currentOffset与maximumOffset的值相等时,说明scrollview已经滑到底部了。也可以根据这两个值的差来让他做点其他的什么事情
if((maximumOffset-currentOffset)<40.0)
{
NSLog(@"-----刷新数据-----");
currentPage++;
[self DataLoad];
}
}
}
判断scrollview 滑到低部,然后加载数据:(注意不要忘记设置代理)