![](/img/trans.png)
[英]Custom UITableView Footer doesn't lock in the bottom as the table view is scrolled
[英]UITableView, make footer not bounce when table view scrolled till the end
当我滚动到表格视图的底部时,最后一个元素(打算是页脚)会与tableview对象一起反弹。
有什么方法可以使我最后一个项目/页脚项目到达时固定在屏幕底部?
You can use below Method, in this way, when you go down in UITableView ,
at that time Stop or turn off bouncing all together?
e.g. .bounces=NO; .alwaysBounceVertical=NO
otherwise Set Yes To all.
this way may be helpful to you.
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
NSLog(@"scrollView.contentOffset.y-%f",scrollView.contentOffset.y);
NSLog(@"tblView.contentSize.height=%f",tblView.contentSize.height-tblView.frame.size.height);
if ([scrollView isKindOfClass:[UITableView class]])
{
if(scrollView.contentOffset.y == tblView.contentSize.height-tblView.frame.size.height)
{
// we are at the end
//Sp do wahtever want to do here.
//set bounce no
}
else
{
//not at END.
//set bounce Yes
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.