我刚刚实现了一个UITableView控制器,由于某种原因,刷新控件没有显示在顶部是否有一些我错了?
ScoresNotificationsPage
- (id)initWithFrame:(CGRect)frame {
self = [self initWithStyle:UITableViewStylePlain];
self.view.backgroundColor = [UIColor whiteColor];
self.view.frame = frame;
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
refreshControl.tintColor = [UIColor redColor];
// Assign the refresh control to the table view controllers refresh property.
[refreshControl addTarget:self action:@selector(changeSorting) forControlEvents:UIControlEventValueChanged];
self.refreshControl = refreshControl;
}
MainViewController
使用
添加ScoresNotificationsPage[self.view addSubview:scoresNotificationsPage.view];