Contents of UIPopover change to random orientation when Modal View is visible and iPad rotated - ipad

I have a UITableView within a navigation controller shown within a popover. When you press a bar button from within the popover (on a detail view), it shows a modal view. If you rotate the iPad with the popover visible and the modal view on top of that, the popover's content changes to a seemingly random orientation as shown below.
Any idea what's going on here?
UPDATE:
I'm trying to implement a solution, maybe there's a better way. When the modal view is dismissed, I send an NSNotification from - (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error to the popover's owner.
When I press cancel, the button is visibly pressed but nothing happens after that and the screen becomes unresponsive. However, rotation still occurs properly.
It would seem that I'm dismissing the popover before the modal view is dismissed. I don't really know any other way of doing this, you're continued help is appreciated.

I had to completely reload the popover and its view controllers. This is the only way I could mask the problem, not solve it, because this seems to be a bug in iOS 3.2.

Have you tried to dismiss the popover and then redisplay it? The UIPopoverController documentation is straightforward in saying that it will often fail to rotate a popover, and suggests redisplaying it as the only solution. I suspect that since your modal view is on top of the view from which the popover was displayed, the popover's controller is not updating its position & orientation.

Related

(iOS) don't move up a modal view when the keyboard appears [duplicate]

I have a viewcontroller from here I am getting a popover. From this popover i am presenting a view as modal view.
There is a textview in it. When editing begins, the entire modal view moves up (which usually people desire). But I do not want it that way.
Is there any way, i can block my modal view from moving up and down on keyboard show and hide ?
If I guessed correctly then you need to set
yourviewControler.modalPresentationStyle=UIModalPresentationPageSheet;
instead of what you are probably using right now
yourviewControler.modalPresentationStyle=UIModalPresentationFormSheet;

Persistent Popover with VoiceOver

I have an iPad popover with a button that triggers a modal segue to a full-screen view controller. It works fine and the popover dismisses itself. But, when VoiceOver is on, the labels of the popover persist and this interferes with the user hearing the new screen's VoiceOver labels. Even though the popover is dismissed, I can see the outlines of its labels as they are selected in VoiceOver. What am I doing wrong?
Just to answer my own question, placing:
self.view.accessibilityViewIsModal = YES;
in my destination view controller's viewWillAppear: resolved the issue.

Modal disappearing after rotating UISplitViewController

I have a strange problem UISplitViewController. I have a button in my master view controller which opens a modal view when tapped (using a simple storyboard segue).
But the modal view disappears when I rotate the iPad, but only when rotating from portrait to landscape. My master view controller is hidden in portrait, like in the native Mail application.
If I'm in landscape (when the master is always visible) and open my modal, rotating the device works correctly and my modal stays on screen.
I tried manually triggering the segue programmatically, if I call performSegueWithIdentifier: on the splitViewController, rotating works both ways. But I was wondering if this was fixable in a simpler way because I have other buttons displaying modals in the master view controller and I don't want to do an IB action for each one and lose the advantages of storyboard segues.
unfortunately it is like that, when your ipad is on portrait mode, you have a popover of your master, it is not the master in another shape. What means that you are presenting a modal using this popover as presentingViewController, so when you move from portrait to landscape the method splitViewController:willShowViewController will make your popover nil as you can see:
- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem
{
// Called when the view is shown again in the split view, invalidating the button and popover controller.
[self.navigationItem setLeftBarButtonItem:nil animated:YES];
self.masterPopoverController = nil;
}
So I understand that is acceptable that your modal is going with it. So, with this you understand why when you put your action an call the performSegueWithIdentifier: on your splitViewController it doesn't happen, your modal is no longer connected with your popover.
So you may ask why it doesn't happen when you move from landscape to portrait.. and the reason is splitViewController:willHideViewController, it hides the viewController it doesn't remove it, so your modal is always connected.
So, unfortunately there is no solution and you will have to perform the actions by code..
I hope it helps,
Roberto

UIActionSheet on iPad comes up from the bottom when the parent view is a UIPopover

On iPad, I have a view that is a popover. There is a button inside the view that shows a UIActionSheet. When I call showFromBarButtonItem:animated, instead of showing up as a popover as I would expect, I instead get an action sheet that comes up from the bottom of the view. Does anyone know a way to force it to be a popover on top of the existing popover? Everything works fine if my view that shows the UIActionSheet is not a popover.
This behavior is probably because you are calling the UIActionSheet object from within your popover controller, which probably has bounds comparable to that of the iPhone screen size. When you call from within this controller the method showFromBarButtonItem:animated: it gets the bounds of this reduced size popover controller and launches the action sheet object just like on an iPhone from the bottom.
What you would probably need to do is nest popover controllers to achieve your desired effect.

UIPopover locking background view

I am trying to replicate the iPad passcode view. Which basically is a popover with no arrow direction, that locks the background view kinda like a modal view controller.
My question: Is there a way to lock the underlying background view when presenting a popover.
My idea: The only real solution that i could come up with is placing that popover inside a modal view controller. and presenting it that way.
Thoughts?
Use the modalInPopover property of your view controller: http://developer.apple.com/iphone/library/documentation/uikit/reference/UIViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006926-CH3-SW72
This question provides some information on making a popover with no arrows, though it's not clear whether it's correct or not: UIPopover without any arrows

Resources