2013-04-24 52 views
0

底部当我用苹果之前UIRefreshControl我能有在刷新控制的这样底部的标签显示:如何添加标签的ODRefeshControl

UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; 
    [refreshControl addTarget:self action:@selector(addReceipt:) 
      forControlEvents:UIControlEventValueChanged]; 
    self.refreshControl = refreshControl; 

    NSString *s = @"Swipe Down to Add Receipt"; 
    NSMutableAttributedString *a = [[NSMutableAttributedString alloc] initWithString:s]; 
    [a addAttribute:NSForegroundColorAttributeName value:[UIColor darkGrayColor] range:NSRangeFromString(s)]; 
    refreshControl.attributedTitle = a; 

现在我切换到ODRefreshControl自定义活动指标,我无法找到解决方案! 我对ODRefreshControl代码(只是为它工作):

ODRefreshControl *refreshControl = [[ODRefreshControl alloc] initInScrollView:self.tableView]; 
    [refreshControl addTarget:self action:@selector(dropViewDidBeginRefreshing:) forControlEvents:UIControlEventValueChanged]; 

回答

0

它看起来并不像它可以支持这种类型的事情了这个控制箱的。看看代码,它看起来不支持attributedTitle或类似的东西。另外,我假设你使用这个控制:

https://github.com/Sephiroth87/ODRefreshControl

如果是这样的话,你可能有几个选择:

  1. 你必须写在ODRefreshControl一些代码自己添加标签,最有可能的方法是initWithScrollView,但这可能不完全准确。
  2. 请开发人员在未来的版本中添加它(看起来您已经做到了)。
  3. 回到使用Apple Refresh控制。如果您想要标题标签,为什么你更喜欢ODRefreshControl
+0

1.这是确定 2.是的,我已经做了 3.我想自定义颜色和活动指示灯 – 2013-04-25 01:06:21

+0

我认为这些是你在这一点上唯一的选择。选项#4可能是编写自己的刷新控制。 – Aaron 2013-04-25 15:38:56