留作开发用不絮叨太多了
- (void)scrollViewDidScrollPoint:(float )locationY scrollView:(UIScrollView *)scrollView{
float al = locationY/270;
float alpha = al>=1? 1:al;
[self.navigationBar setBackAplha:alpha];
//获取tableView当前的y偏移
CGFloat contentOffsety = scrollView.contentOffset.y;
//如果当前的section还没有超出navigationBar,那么就是默认的tableView的contentInset
if (contentOffsety<=(self.tableView.bounds.size.height-64)&&contentOffsety>=0) {
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
}else if(contentOffsety>=self.tableView.bounds.size.height-64){ //当section将要就如navigationBar的后面时,改变tableView的contentInset的top,那么section的悬浮位置就会改变
self.tableView.contentInset = UIEdgeInsetsMake(64, 0, 0, 0);
}
}