iOS6 UITableView 底部的 UIRefreshControl? [英] UIRefreshControl at the bottom of the UITableView iOS6?

查看:31
本文介绍了iOS6 UITableView 底部的 UIRefreshControl?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在UITableView的底部添加UIRefreshControl?我会用它来加载更多数据.拜托,有什么建议吗?

Is it possibile add UIRefreshControl at the bottom of the UITableView? I would use it to load more data. Please, Any suggest?

推荐答案

我相信这个问题不会有任何简单的解决方案.可能有人可以编写一个单独的库来实现这种行为,而且一旦你在 tableview 中缓存数据,它会导致更多的复杂性.

I believe there won't be any simple solution to this problem. May be someone could write a separate library to implement this behaviour plus it will cause more complications once you cache data in tableview.

但让我们分解问题,这可能会帮助您实现您想要的.我使用以下代码在应用程序中添加了更多行:

But let us break down the problem and that might help you in achieving what you want. I have used the following code to add more rows in the app:

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
    float endScrolling = scrollView.contentOffset.y + scrollView.frame.size.height;
    if (endScrolling >= scrollView.contentSize.height)
    {
        NSLog(@"Scroll End Called");
        [self fetchMoreEntries];
    }
}

或者你可以这样做:

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    if ((scrollView.contentOffset.y + scrollView.frame.size.height) >= scrollView.contentSize.height)
    {
        if (!self.isMoreData)
        {
            self.MoreData = YES;

            // call some method that handles more rows
        }
    }
}

你一定在我上面描述的许多问题中看到过这样的方法,当然不是你所要求的.但是你可以做的是在上面的代码加载更多数据的过程中,你可以添加一个子视图并显示一些类似于 UIRefreshControl 提供的图像.在子视图中添加图像以显示为进度,直到执行上述代码.首页这有帮助.

You must have seen such methods in many question as i have described above and certainly not what you have asked for. But what you can do is while the above code in in process to load more data, you can add a subview and show a couple of images similar to what UIRefreshControl offers. Add the images in the subview to be shown as a progress until the above code gets executed. Home this helps.

顺便说一句,我建议您不要这样做,因为除非您只是出于学习目的,否则制作这么小的东西只会浪费您的时间.

By the way, i will suggest you not to do that as it will just waste your time for making something so smaller unless you are just doing it for learning purposes.

这篇关于iOS6 UITableView 底部的 UIRefreshControl?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆