UIRefreshControl at the bottom of the UITableView iOS6?

前端 未结 8 2080
你的背包
你的背包 2020-12-01 06:27

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

8条回答
  •  我在风中等你
    2020-12-01 06:50

    For UITableView I suggest the following approach:

    -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
    {    
        // if this is the last row that we have in local data
        // and we didn't reach the total count of rows from the server side
        if (count == indexPath.row+1 && count < total)
        {
            // .. fetch more rows and reload table when data comes
        }
    }
    

    I didn't use the scroll view methods intentionally because the scroll view is slow. It happens that scroll view scrolls, we request more data, refresh more rows, and scroll view is not yet finished with scrolling, it is still decelerating and causing problems with fetching more data.

提交回复
热议问题