Hi,
maybe this is a noob question, but this already frustrates me the whole day.
I am currently developing a Split View based iPad application, but used the "basic" Window-based application template. I have a button on the left side of the split view which should show another view on the right side when pressed.
In portrait mode the left part is shown via a popover controller accessed by a button in a navigation bar.
This works so-far, but in landscape mode the size of the right view is wrong - components go over the right edge of the screen.
Here is how my project is set up:
- The App Delegate loads the SplitViewController, which itself consists of two UIViewControllers, named LeftController and RightController. The RightController is just "dummy", it belongs to a view which just displays an empty page.
- The view belonging to the LeftController contains a button named "Settings", the Outlet and IBAction things are declared in the LeftController
- When pressing the button on the left side, the SettingsController which shall then show its view on the right side is created programmatically and added as a subview to the RightController.
Here is a code snippet of the action:
Code:
-(IBAction)settingsBtnPressed:(id)sender {
if(!settingsViewVisible) {
settingsViewVisible = YES;
sc = [[SettingsController alloc] initWithNibName:@"Settings" bundle:nil];
[sc setParentLeftController:self];
[[myRightController view] addSubview:sc.view];
[myRightController dismissPopoverIfNeeded];
}
}
the setParentLeftController and dismissPopoverIfNeeded are methods I wrote to interact with the caller.
Now, when in landscape mode, the view seems to be made 1024x768 pixels wide and put beneath the left view, thus chopping off some parts at the right.
The flexibility settings are correctly set in the nib.
When deselecting the things right and below the flexibility arrows, resizing occurrs correctly when starting in portrait mode, but when starting in landscape mode, I have the same chopping problem.
Any ideas?