I have a UITableview inside a popover. Initially the popover is displayed in portrait and upon rotation to landscape it disappears as expected. When rotated back to portrait and the popover is caused to be presented again, the tableview is shown in landscape mode inside the popover. How can I prevent the tableview from rotating, or cause it to rotate back?
Keep a reference to the popover in the view controller that opens it. That view controller will receive willRotate messages. You can dismiss the popover from there.
Related
iOS 8. I am presenting a view controller with presentation style: UIModalPresentationOverCurrentContext. This works great until I rotate my device, at which time the presented view is not properly adjusted.
Example: I presented over a portrait context. Entire screen covered by my new view (which has semi-transparencies). I rotate to landscape. The presented view rotates, but is now centered and remains at portrait width.
Both the presenting VC and the presented view are created in a storyboard using autolayout. Since I can't add constraints to the topmost view in a VC (right?) I'm not sure how to keep my presented view entirely covering the view below it.
This can happen if Presentation in the Segue is set to Page Sheet. In the storyboard, change the presentation to Full Screen or Over Full Screen
Since you're not using a segue, use UIModalPresentationOverFullScreen.
I have a tabbarcontroller with 3 tabs that are splitviewcontrollers.
It works fine except when:
in portrait view tap the rootview button to show the master
popover.
switch to any other tab
rotate to landscape (the masterview controller of that tab appears)
switch back to first tab and the detail view controller is in the
right position (320 px from left border) but instead the master view
I have a black screen
I enumerated the splitviewcontroller subviews but the masterview is not there.
If I rotate the device in portrait and back in landscape, the master view appears.
I try to better explain with this picture:
It seems to me that the problem might be caused by all of your UISplitViewControllers using the same delegate, probably your AppDelegate. That might cause the behavior you're seeing, since when one UISplitViewController returns false from collapseSecondaryViewController:ontoPrimaryController, they all will return false, giving you the padding on the left to make space for the masterViewController. But your UISplitViewControllers which are not active aren't showing the masterViewController, so you get a blank space, instead of what you expect.
I have an issue with the navigation bar.
I have screen with NavBar and opened half transparent view on full screen (it covers NavBar).
Then, if I change device orientation by 180 degree (my app only, for landscape), then NavBar appears on top while animation. NavBar goes back under transparent view after animation completes.
Does somebody face the same issue?
How are you presenting the transparent view? If you are presenting it modally or using a UIPopover, both of these will be removed from the window during the rotation and then added back afterwards.
Have you perhaps tried adding the view as a subview of the window, above the navigation bar, like such?
[self.view.window insertSubview:your_view aboveSubview:self.navigationController.view];
I have created a modal view in Portrait mode. when it is in lanscape mode it is not rotating.
How to rotate a modal view from Portrait to Lanscape in splitViewController?
I have a similar problem. The modal view is loaded from the DetailViewController, and when the iPad is rotated, the modal view disappears from view completely.
The closest I've come to a fix is, after rotating, to check whether a modal view was loaded, and then reload it, like so:
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
if(self.modalViewController)
[self.modalViewController.view.window reloadInputViews];
}
I have an iPad Split View Application that brings up a modal view to display certain content. When I bring up the modal (in PageSheet style) and then change from Portrait to Landscape (or vice-versa) and then dismiss the modal the orientation of the detailViewController (the parent of the modal) turns 90 degrees.
So if I am in landscape mode when I close the modal the right pane will turn as if it were in portrait mode but the device is still in Landscape and the rootViewController is still visible. After this happens no rotation will solve the problem until the view is removed.
Any idea what I've screwed up here? I've had a ton of trouble with iPad rotation handling in general but this one is really giving me problems.
If you are presenting the modal view from either of the two sub-views of the SplitViewController, then you will have the orientation problems. Just present the modal view from the SplitViewController.