Note that there are some explanatory texts on larger screens.

plurals
  1. POCentering Activity Indicator View to UITableView
    primarykey
    data
    text
    <p>I created a <code>UITableViewController</code> in my Storyboard and then dragged a Activity Indicator View into the controller (along with creating an outlet for it), which I start and stop animating before and after some json content has loaded.</p> <p>I can see the ajax spinner working fine, but it's displaying visually right beneath my navigator / title area, and when I attempt to center it, it appears centered width wise, appears at the very top near the status area...</p> <p>I tried the following in an attempt to center it... Here's a quick look at my <code>viewDidLoad</code>:</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; self.listLoader.center = CGPointMake( [UIScreen mainScreen].bounds.size.width/2,[UIScreen mainScreen].bounds.size.height/2); UITableView *appDelegate = (UITableView *)[[UIApplication sharedApplication] delegate]; [appDelegate.window addSubview:self.listLoader]; self.operationQueue = [NSOperationQueue new]; NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(getPosts) object:nil]; [self.operationQueue addOperation:operation]; } </code></pre> <p>Please note that both my <code>startAnimating</code> and <code>stopAnimating</code> are contained within my <code>getPosts</code> method and are performed on the main thread. So, to avoid confusion, I can actually see the spinner, it's just all the way into the status area. In fact if I remove the lines...</p> <pre><code>self.listLoader.center = CGPointMake( [UIScreen mainScreen].bounds.size.width/2,[UIScreen mainScreen].bounds.size.height/2); UITableView *appDelegate = (UITableView *)[[UIApplication sharedApplication] delegate]; [appDelegate.window addSubview:self.listLoader]; </code></pre> <p>The spinner appears, right beneath the navigation bar...</p> <p>How exactly do I center this??? I figured the method above would work, but obviously it's not working....</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload