I have the following question:
I got some code that gets called when an user logs in. The code has to call another view controller and has to show another view. To show to new view, i got the following code:
[scrollView removeFromSuperview];
Form1 *formcontroller1 = [[Form1 alloc] initWithNibName:@"Form1" bundle:[NSBundle mainBundle]];
[self.view setAutoresizesSubviews:YES];
[self.view addSubview:formcontroller1.view];
[scrollView release];
The problem is, when the other view is loaded and i rotate the device, the view of the new nib is not resizing correctly.
EDIT:
I wasn’t dismissing the current viewcontroller so some properties remained. What i did is this:
[scrollView removeFromSuperview];
[self dismissModalViewControllerAnimated:YES];
Form1 *formcontroller = [[Form1 alloc] init];
[self presentModalViewController:formcontroller animated:YES];
[scrollView release];
You should check the autoresizing properties of your nib view in Interface Builder…
It should look like in the picture:
The middle arrows are dimmed, but still active. This is where autoresizing is set. You could try and set that property programmatically by assigning in your controller
viewDidLoadmethod:You should also ensure that both your view and its superviewhave the "autoresize subviews" button checked (in the first pane of the inspector in IB)
OLD ANSWER:
How is
Form1– shouldAutorotateToInterfaceOrientation: defined?E.g.:
to support all orientations.