0

我正在使用 UIRefreshControl 在我的 IOS 应用程序中实现下拉刷新。它工作正常。但是经过几次刷新后,恰好是第三或第四个,它会稍微裁剪标题,然后立即错位。请检查所附图像以获取屏幕截图

正常工作 标题被裁剪 标题左对齐

我在不同的屏幕中使用 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;

未对齐和裁剪发生在刷新时。刷新完成后就正常了。

如何使其正常工作?

谢谢

4

0 回答 0