Search code examples
iphoneiosuitableviewuiactivityindicatorview

Issue in activityIndicatorView to show in UITableViewController?


Using activityIndicatorView to show front of the UITableViewController, but it show inside the UITableViewController, How to fix this?

I tried this:

activityView = [[activityIndicatorView alloc] initWithFrame:CGRectMake(60, 130, 200, 100)];
    [self showActivity];

-(void) showActivity
{
   
    [self.tableView addSubview:activityView];
}

enter image description here


Solution

  • Add it in view as a subview instead of UITableView and set as a superview so its display front of view like bellow:

    [self.view addSubview:activityView];
    [self.view bringSubviewToFront:activityView];