+1  A: 

You should post your code, but in general, you can make a UIView fill the screen as follows:

UIView *foo = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,480)];

And you can set the frame later:

foo.frame = CGRectMake(0,0,320,480);

To fill the screen, you should use a 320 x 480 Rectangle, at origin (0,0). That's what that CGRectMake function above creates.

Andrew Johnson
I'm creating all the views through the interface builder...should I still do this to ensure it fills the screen?
BWC
Well, this would work if you called it in the ViewDidLoad function of your ViewController, but I have no idea how to use Interface Builder. I do everything programatically.
Andrew Johnson
+1  A: 

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:

NSLog(@"Height is %f", self.view.frame.size.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:

NSLog(@"y origin is %f", self.view.frame.origin.y);

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:

CGPoint absoluteOrigin = [self.view convertPoint:self.view.frame.origin
                                          toView:self.view.superview];
NSLog(@"y origin in superview is %f", absoluteOrigin.y);

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:

CGRect appFrame = [[UIScreen mainScreen] applicationFrame];
CGFloat screenHeight = appFrame.size.height;

The applicationFrame property takes into account whether or not the status bar is displayed.

Tyler
Thank you for the info, I'm not a big fan of using magic numbers either
BWC
+1  A: 

I've had this problem before, I fixed it by just moving the view down 20 pixels... When you use interface builder it has that nifty little "simulate status bar" or "simulate toolbar" feature but I think its kind of finnicky.

Both Andrew and Tylers answers should work though, no shame in doing things programmatically :). If you are creating the stuff in interface builder, just do Andrew's second line though, don't need to reinitialize.

kiyoshi
A: 

Ok, well I figured it out and now I feel kind of stupid...I went back to IB and realized that the height of each view was set at 460 and not 480...you guys did give me a bunch of good information and I appreciate it all. I wish I could mark them all as answers.

Thank you again, BWC

BWC
FYI this was likely caused by the simulated metrics you can adjust in IB. They actually resize the view when you adjust them.
Lounges
A: 

I have this problem but when i try to change size it is not possible to do so. The size box in IB is not able to edit.

Anyone that can suggest how to do this?