UITefresh控件位于UITableView iOS6的底部? [英] UIRefreshControl at the bottom of the UITableView iOS6?

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

问题描述

是否有可能在 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.

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

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