gpt4 book ai didi

ios - 如何在tableview底部显示上拉刷新控件?

转载 作者:可可西里 更新时间:2023-11-01 03:06:09 25 4
gpt4 key购买 nike

在 tableView 中,当我从顶部下拉时,它正在获取数据。但是如果我想在tableView中从底部拉起数据,我该如何实现,请给我建议

最佳答案

我也遇到了这种情况,最后我找到了一些答案,比如 UIRefreshControl at the bottom of the UITableView iOS6?从而在页脚 View 中实现了我们的 UIActivityIndi​​catorView。因此它现在工作正常。

    // call this method in `viewDidLoad` and connect the tableview delegates.

-(void)initializeRefreshControl
{
indicatorFooter = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(tableVeiwMarkets.frame), 44)];
[indicatorFooter setColor:[UIColor blackColor]];
[indicatorFooter startAnimating];
[self.tableVeiwMarkets setTableFooterView:indicatorFooter];
}

-(void)refreshTableVeiwList
{
// your refresh code goes here
}
-(void)scrollViewDidScroll: (UIScrollView*)scrollView
{
if (scrollView.contentOffset.y + scrollView.frame.size.height == scrollView.contentSize.height)
{
[self refreshTableVeiwList];
}
}

关于ios - 如何在tableview底部显示上拉刷新控件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30437298/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com