The text is offset wrong by the first launch of UIRefreshControl... later sometimes the refresh text doesn't show up at all and just the spiny is visible
I don't think i had this issue with iOS6... might be related to iOS7
Is in a UITableViewController added as a child to a VC, which resides in a modal presented UINavigationController
- (void)viewDidLoad { [super viewDidLoad]; [self setRefreshControlText:@"Getting registration data"]; [self.refreshControl beginRefreshing]; } - (void)setRefreshControlText:(NSString *)text { UIFont * font = [UIFont fontWithName:@"Helvetica-Light" size:10.0]; NSDictionary *attributes = @{NSFontAttributeName:font, NSForegroundColorAttributeName : [UIColor blackColor]}; self.refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:text attributes:attributes]; }
This is definitely an iOS 7 bug, but I haven't figured out exactly what caused it. It appears to have something to do with the view hierarchy — adding my UITableViewController as a child view to a wrapper view controller appeared to fix it for me at first, although the bug is back since iOS 7 GM.
It looks like adding the following code to your UITableViewController after creating the refresh view fixes the positioning issue for good:
dispatch_async(dispatch_get_main_queue(), ^{ [self.refreshControl beginRefreshing]; [self.refreshControl endRefreshing]; });
calling endRefreshing
under viewWillAppear
did it for me:
-(void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.refreshControl endRefreshing]; }
Under iOS7 with a custom UITableViewController
inside a UINavigationController
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With