1

I've just implemented a UITableView controller and for some reason the refresh control isn't showing up at the top is there something that I've got wrong?

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

Adding the ScoresNotificationsPage with

[self.view addSubview:scoresNotificationsPage.view];
  • Try to add the ScoresNotificationsPage as a child view controller. Check the second answer in this question: http://stackoverflow.com/questions/12497940/uirefreshcontrol-without-uitableviewcontroller – Valent Richie Aug 08 '13 at 03:25
  • 1
    are you playing with background view? I had the same problem, but ut turned out that in iOS7 backgroundView is on top of refresh control. – raistlin Dec 19 '13 at 15:26

0 Answers0