UIView in the center of the UITableViewController

How can I put my UIView ( loadingView), which was loaded from the UITableViewController in the center of the screen, regardless of the scroll position?

+3
source share
3 answers

You can add a view to the tableview supervisor, for example:

loadingView.center = self.tableView.center;
[self.tableView.superview addSubview:loadingView];

and remove it (removeFromSuperview) when done with it. It will be displayed on top of the table, in the center of the table, but will not scroll along with the table.

+8
source

UIViewController UITableViewController. , . UITableViewDelegate UITableViewDataSource .h, . ol 'UITableViewController.

+1

Instead of adding loadView to the table sub-screen. Do this instead:

    [[UIApplication sharedApplication].keyWindow addSubview:loadingView];

This decides to switch the code to a UIViewController

0
source

All Articles