On iPhone, when adding a subview to the window view manually, do I need to account myself for the 20px of the top status bar? That is, do I need to create views with a frame set to (0, 20, 320, 460):
UIView *myView = [[UIView alloc] initWithFrame:CGRectMake(0, 20, 320, 460)];
[window addSubview:myView];
If so, are there some official guidelines related to this? I just got stuck on it, and after some experimenting it seems that it is indeed the case. This would imply that when a view is created from a nib file, it's always silently shifted by 20 pixels down because when one uses the Interface Builder, the view height of already set to 460px and when the view is added to window, it's already properly positioned.
On the other hand, this looks a bit clunky and shortsighted. Why would Apple hardcode the 20 pixels and do the magic offsetting? Why would I, as a programmer, need to know and assume anything about the status bar? Why is not the window already offset by itself? Is it a known limitation / issue? Or does it have a reason?