views:

23

answers:

2

I am just looking at setting a up a custom UIViewController programatically (see code below) and I am just curious about the white line I am getting at the bottom of the display, I don't see this when I create the view using a NIB in InterfaceBuilder. Is it just a case of offsetting the frame down by the height of the status bar or am I missing something else?

EDIT:

Found it:

viewController.view.frame = CGRectMake(0.0,20.0,320.0,460.0);

CODE

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    MyController *tempController = [[MyController alloc] init];
    [self setMyController:tempController];
    [window addSubview:[myController view]];
    [window makeKeyAndVisible];
    return YES;
}

SCREEN

alt text

Much appreciated ...

Gary

+1  A: 

You could try setting up the frame of your controller's view to see what happens:

tempController.view.frame = CGRectMake(0, 0, 320, 480);

By the way, you have a probable memory leak in your method (that should be catched by clang if you enable it).

jv42
jv42, yes I do thank you, I forgot the [tempController release]; after setting my property (which is set to retain). Thank you for the pointer on setting the view.frame, just figured it out after posting.
fuzzygoat
A: 

i guess this problem is related to bounds or Applicationframe. set everywhere bounds -'[[UIScreen mainScreen]bounds];' let's see ...

pawan.mangal