【问题标题】:Change UIRefreshControl title before showing it - Objective-c iOS在显示之前更改 UIRefreshControl 标题 - Objective-c iOS
【发布时间】:2016-07-21 09:25:10
【问题描述】:

是否可以在 UIRefreshControl 标题出现在屏幕上之前更改它?

实际上,我使用这段代码来更改我的更新方法中的标题:

NSString *refreshControlTitle = @"Pull to refresh...No new item to show";
NSDictionary *attrsDictionary = [NSDictionary dictionaryWithObject:[UIColor colorWithRed:0.35 green:0.78 blue:0.98
                                                                                                   alpha:1.0]
                                                                            forKey:NSForegroundColorAttributeName];
NSAttributedString *attributedTitle = [[NSAttributedString alloc] initWithString:refreshControlTitle attributes:attrsDictionary];
refreshControl.attributedTitle = attributedTitle;

(根据情况会进行一些文本更改),但仅在刷新完成后文本才会更改。

如何在用户开始看到 refreshControl 之前实现文本?

提前致谢!

【问题讨论】:

  • 你在哪里调用了这个刷新方法
  • 看到这个对你有帮助的时候stackoverflow.com/questions/19121276/…
  • @Anbu.Karthik 我从 scrollViewDidEndDecelerating 调用我的刷新方法,但提供的链接对我没有帮助:/

标签: ios objective-c uirefreshcontrol


【解决方案1】:
- (void) scrollViewWillBeginDragging:(UIScrollView *)scrollView {
}

尝试在这个方法中添加标题

【讨论】:

    猜你喜欢
    • 2015-11-24
    • 2014-03-16
    • 2022-08-22
    • 2017-01-22
    • 2021-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多