菜鸟教程小白 发表于 2022-12-12 15:04:49

ios - 拉动刷新不会分离(不会停止刷新)-Objective-C


                                            <p><p>我面临的问题是我的 <strong>tableView</strong> 在我拉下(刷新)它后不会停止刷新。我正在使用来自 github 的 Yalantis “Pull to Refresh” repo(可在此处找到:<a href="https://github.com/Yalantis/Pull-to-Refresh.Rentals-iOS" rel="noreferrer noopener nofollow">https://github.com/Yalantis/Pull-to-Refresh.Rentals-iOS</a>)并尝试将其实现到我现有的项目中。</p>
<p>我已经实现了头文件,添加了属性,但是在说明中它的 unrefresh(如果你愿意的话)是一个链接到按钮的 IBAction。显然不是我想要的。这是我正在使用的代码</p>
<hr/>
<p>请记住,我已经拿出了很多东西,只是保留了相关的东西。任何帮助都会很棒。谢谢。</p>
<pre><code>- (void)viewDidLoad {
;

;

}
- (void)didReceiveMemoryWarning {
;
// Dispose of any resources that can be recreated.
}

- (void)viewWillAppear:(BOOL)animated {
;

;
PFQuery *query (i perform query for table)
}


# pragma mark - YALSunyRefreshControl methods

-(void)setupRefreshControl{

self.sunnyRefreshControl = [YALSunnyRefreshControl attachToScrollView:self.tableView
                                                               target:self
                                                      refreshAction:@selector(sunnyControlDidStartAnimation)];
}

-(void)sunnyControlDidStartAnimation{

// start loading something
;

}



-(IBAction)endAnimationHandle{

;
}
</code></pre></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>其实你可以随时调用该方法</p>

<pre><code>;
</code></pre>

<p>按钮处理程序只是示例^_^</p>

<pre><code>(IBAction)endAnimationHandle{;}
</code></pre>

<p>如果您仍有问题,您可以在 <a href="https://github.com/Yalantis/Pull-to-Refresh.Rentals-iOS" rel="noreferrer noopener nofollow">github repo</a> 上创建问题。 .谢谢你</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 拉动刷新不会分离(不会停止刷新)-Objective-C,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/29664631/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/29664631/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 拉动刷新不会分离(不会停止刷新)-Objective-C