0

I am using UIRefreshControl to implement pull down to refresh in my IOS app. It works fine. But after a few refreshes say for exactly third or fourth one it crops the title a bit and immediately it gets misaligned. Please check the attached images for screen shots

Normal working Title cropped Title aligned to left

I am using the UIrefresh Control in different screens. Every screen is showing the same behaviour. Some of them are UITableViewControllers and some others are having UITableView inside a UIViewController.

Here is the code how I create the title for UIRefreshControl

NSString *titleStr = [NSString stringWithFormat:@"Last updated at %@",[appDelegate getLastUpdatedDate]];
    NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:titleStr];
    [title addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(0, titleStr.length)];
    self.refreshControl.attributedTitle = title;

The misalignment and cropping happens while its refreshing. It becomes normal once the refresh is finished.

How to make this work properly?

Thanks

MrBoJangles
  • 12,127
  • 17
  • 61
  • 79
Zach
  • 9,989
  • 19
  • 70
  • 107
  • Is the behaviour persistent (i.e. does it happen every time?) NSAttributedString can have its own text alignment; see: http://idipaksonara.wordpress.com/2012/12/21/ios-6-nsattributedstring-set-text-underline-paragraph-styles-and-glyph-form/ for an example/ – Edward Nov 12 '13 at 10:46
  • Yes it happens always. Always on third or fourth attemtpt and once this happens it is always the same – Zach Nov 12 '13 at 10:50

0 Answers0