【问题标题】:UITableView, make footer not bounce when table view scrolled till the endUITableView,当表格视图滚动到最后时,使页脚不反弹
【发布时间】:2015-09-14 00:12:39
【问题描述】:

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

有没有办法让最后一个项目/页脚项目在到达时固定到屏幕底部?

【问题讨论】:

  • 你不能关闭一起弹跳吗?例如.反弹=否; .alwaysBounceVertical=NO;
  • @almas 有效,但我喜欢弹跳,我只是不想让页脚弹跳

标签: ios uitableview scroll footer


【解决方案1】:
    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
                }
            }
        }

【讨论】:

    猜你喜欢
    • 2011-09-19
    • 1970-01-01
    • 2014-04-14
    • 1970-01-01
    • 2011-11-04
    • 1970-01-01
    • 2017-01-28
    • 1970-01-01
    • 2013-04-26
    相关资源
    最近更新 更多