如何在UITableView上更改Pull的文本颜色?

时间:2016-02-25 15:44:25

标签: ios objective-c uitableview pull-to-refresh

如何更改文字的颜色' loading ...'?

enter image description here

1 个答案:

答案 0 :(得分:3)

尝试:

//the color of the background
self.refreshControl.backgroundColor = [UIColor purpleColor];

//the color of the spinner
self.refreshControl.tintColor = [UIColor whiteColor];

// the color of the label
NSString *title = @"loading...";
NSDictionary *attrsDictionary = [NSDictionary dictionaryWithObject:[UIColor whiteColor]
                                                                    forKey:NSForegroundColorAttributeName];
NSAttributedString *attributedTitle = [[NSAttributedString alloc] initWithString:title attributes:attrsDictionary];
self.refreshControl.attributedTitle = attributedTitle;