UITableView,当表格视图滚动到结束时,页脚不会反弹

时间:2015-06-26 23:02:13

标签: ios uitableview scroll footer

当我滚动到表格视图的底部时,最后一个元素(打算作为页脚)与tableview对象一起反弹。

有没有办法可以制作这个最后的项目/页脚项目,当它到达时会固定在屏幕的底部?

1 个答案:

答案 0 :(得分:0)

    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
                }
            }
        }