tags:

views:

9

answers:

1

I have noticed that when you create a new xcode project as a view based application it creates a view NIB and when that NIB is loaded it loads below the menu bar. I am trying to create a window based application and programmatically add a view to the window, but the view gets loaded underneath the menu bar so part of the view is being obstructed.

i have tried

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

// Override point for customization after application launch.

MYViewController *viewController = [[MYViewController alloc] initWithNibName:@"MYViewController" bundle:nil];

[window addSubview:viewController.view];
[window makeKeyAndVisible];

return YES;

}

and i have also tried changing the "wantsFullScreenLayout" property of the view controller to FALSE;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

// Override point for customization after application launch.

MYViewController *viewController = [[MYViewController alloc] initWithNibName:@"MYViewController" bundle:nil];


viewController.wantsFullScreenLayout = NO;

[window addSubview:viewController.view];
[window makeKeyAndVisible];

return YES;

}

any help would be appreciated

Thanks

A: 

found it!

[MYViewController.view setFrame:[[UIScreen mainScreen] applicationFrame]];
swnsn