经过几次刷新后,UIRefreshControl标题变得不对齐

时间:2013-11-12 10:15:27

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

我正在使用UIRefreshControl在我的IOS应用程序中实现下拉刷新。它工作正常。但经过几次刷新后,正好是第三或第四次,它会稍微调整标题并立即失调。请查看附加的图像以获取截屏

Normal working Title cropped Title aligned to left

我在不同的屏幕中使用UIrefresh控件。每个屏幕都显示相同的行为。其中一些是UITableViewControllers,另一些是在UIViewController中有UITableView。

以下是我为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;

错位和裁剪发生时令人耳目一新。刷新完成后恢复正常。

如何正常运作?

由于

0 个答案:

没有答案