views:

160

answers:

1

In a view of my app I subclass tableViewController and has an activity indicator shown up when the table content is loading. I put it in the center of the screen but it scroll with the tableView (I guess the reason is I add it as a subview of the table view). Is there a way that I can keep the activity indicator in the center of the screen even the table is scrolling?

Thanks in advanced.

+3  A: 

You could either subclass a UIViewController instead, and set a table property, adding a UITableView as a subclass to the UIView, making it behave exactly like a UITableViewController.

Or, more simply, you could just add the UIActivityIndicator as a subview to the main window.

Tom Irving
+1. It is so much more flexible to subclass `UIViewController` and add a table view and other subviews to it, than to be confined to a table view controller.
Alex Reynolds
Thanks for helping. I subclass UIViewController and it works fine now =)
Brian