tags:

views:

145

answers:

1

I am trying to create a mid-size screen for my app on iPad.

In didFinishLaunchingWithOptions(), I do this:

CGRect winRect = CGRectMake(100,100,500,500);
navController.view.frame = winRect;

the screen comes up fine and I can click around and do stuff until the orientation changes. It takes the screen to original full size - how can I make it stick to my winRect frame? I tried setting the parentViewController.view.frame/view.frame to winRect in willRotateToInterfaceOrientation() but no good.

Any ideas?

Thanks.

+2  A: 

Generally, you shouldn't mess with the frame of a view controller's view. View controllers tend to resize their views on many occasions, for example when toolbars and navigation bars are hidden or made visible or when the interface orientation changes.

For custom-sized views, create a separate view, set its frame to your custom size and add it as a subview to your view controller's view.

Ole Begemann