Once again I’ve searched for about 45 minutes for an answer to this question and I thought I might have found the answer but then the situation I was reading wasn’t exactly like the one I’m running into.
when I add my view it seems that it’s not completely covering the window I was able to get rid of the status bar at the top but there is a section of space at the bottom that the view is not covering
alt text http://img177.imageshack.us/img177/8844/picture1zjv.png
as you can see from the screenshot there is an orange bar…it’s orange because I know what it actually is under there (it’s the viewController’s view but everything I try I can’t seem to get the added view to cover the screen.
this is the only code that’s run
- (void)viewDidLoad {
[super viewDidLoad];
[self.view addSubview:mainMenu];
}
Any help would be appreciated.
There are a few things that might be going wrong:
Your frame might be too short. In
viewDidLoad:you can add a debug statement to check its height:It looks like you want that value to be 480, the full height of the screen.
Your origin might be too high. Similarly check your y offset:
It looks like you want that value to be 0.
The origin of your superview might be too high. Assuming you this view only has one superview, this code will help check the absolute coordinates of your view’s origin:
You can just tag on a few extra
.superview‘s to find out the coordinates in terms of the prior views.By the way, instead of just using 480 as a magic number in your code, you might want to do something like this to get the full height:
The
applicationFrameproperty takes into account whether or not the status bar is displayed.