Uitableview 向UIRefreshControl添加AttributeTitle时出现问题

Uitableview 向UIRefreshControl添加AttributeTitle时出现问题,uitableview,ios7,uirefreshcontrol,Uitableview,Ios7,Uirefreshcontrol,好的,我有一个应用程序,我正在尝试在iOS 7中使用。有一个简单的UITableViewController。我想向表中添加一个UIRefreshControl 如果我加上它,没有任何标题,那么我可以在我的桌子上下拉,我看到控制,它旋转,一切都很好 但是我想给控件添加一个标题,并使其居中。所以我这样做了: self.refreshControl = [UIRefreshControl new]; [self.refreshControl addTarget:self action:@select

好的,我有一个应用程序,我正在尝试在iOS 7中使用。有一个简单的UITableViewController。我想向表中添加一个UIRefreshControl

如果我加上它,没有任何标题,那么我可以在我的桌子上下拉,我看到控制,它旋转,一切都很好

但是我想给控件添加一个标题,并使其居中。所以我这样做了:

self.refreshControl = [UIRefreshControl new];
[self.refreshControl addTarget:self action:@selector(doRefresh) forControlEvents:UIControlEventValueChanged];
NSMutableParagraphStyle* paragraphStyle = [NSMutableParagraphStyle new];
paragraphStyle.alignment = NSTextAlignmentCenter;
self.refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to refresh" attributes:@{NSParagraphStyleAttributeName : paragraphStyle}];
这在iOS6中非常有效。但在ios7中,我必须向下拉100多个像素,才能看到UIRefresh控件。而且,在这种情况发生后,我注意到我可以把桌子拉下来,它粘在那里,好像在所有其他的细胞中有一个白色的大细胞

但是,如果我不设置AttributeTitle,它也会像预期的那样工作

我在附上我观点的局部照片。您将看到UIRefresh控件,从顶部向下超过一英寸。“Unspecified”是我表格中的第一个单元格。

这对我很有用:

UIRefreshControl *refreshControl = [UIRefreshControl new];
refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to refresh" attributes:@{NSParagraphStyleAttributeName : paragraphStyle}];

self.refreshControl = refreshControl;

想透露一下“段落风格”的用法吗?添加attributedTitle后,我必须设置self.refreshControl。