0

我想在我的应用程序中使用EGORefreshTableHeaderView

我的应用程序中有不同的 UITableViews。在其中一个中,我有一个 UIView 作为页脚,而在另一个中没有。在 EGORefreshTableHeaderView 中检查此代码:

- (void)egoRefreshScrollViewDidScroll:(UIScrollView *)scrollView {
    if (_state == EGOOPullRefreshLoading) {
        CGFloat offset = MAX(scrollView.contentOffset.y * -1, 0);
        offset = MIN(offset, 60);
        scrollView.contentInset = UIEdgeInsetsMake(offset, 0.0f, 0.0f, 0.0f);
     }

如您所见, contentInset.bottom 是0.0f. 结果是带有页脚的 TableView 我有问题。如何检查是否scrollView有页脚?

那我可以说:

if(ScrollView has footer)
      bottom = 50;
else
     bottom = 0;
4

1 回答 1

0

这是我到目前为止找到的解决方案:

CGFloat bottom = 0.0f;
if([scrollView isKindOfClass:[UITableView class]]) {
    if(((UITableView *)scrollView).tableFooterView)
        bottom = 50.0f;
}
[scrollView setContentInset:UIEdgeInsetsMake(0.0f, 0.0f, bottom, 0.0f)];
于 2012-11-11T18:46:06.190 回答