Code:
...
// This view contains the table view and the status bar
UIView *totalView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
[totalView addSubview:tableView];
[totalView addSubview:statusView];
self.view = totalView;
...
Thank you for this...it fixed a weird bug I (and maybe everyone) had - a view with two subviews, UIToolbar at the top and UITableView underneath it.
In the simulator, the toolbar would stay static when scrolling the table view up and down.
On the iphone, the same thing would happen
until the top cell was reached when scrolling down, and then the toolbar would follow the top of the table down.
Most odd.
I was adding the two subviews directly to the controllers view, as in:
Code:
[self.view addSubview:toolbar];
[self.view addSubview:tableview];
On a hunch, I tried your method...creating an intermediate UIView, adding the subviews to that, and then assigning that view to the current controllers view. It works!
Not sure why the difference, but it appears to have appeased the xcode gods.