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
Related
I have a UINavigationController that I'm presenting in a popover using UIPopoverPresentationController.
The navigation controller must be presented when displayed in both popover and fullscreen mode (as the adaptive system so chooses.)
I have all this working.
The problem comes when I want to show/hide a dismiss button in the navigation controller depending on how it's being presented. I can't seem to determine whether I'm popover or fullscreen?
The WWDC stuff talks about returning a new navigation controller in presentationController:viewControllerForAdaptivePresentationStyle - but that's no good in my case as my navigation controller may have had other controllers pushed onto it and so cannot simply be swapped out.
Any pointers would be most welcome.
Thanks
[UPDATE] So the presenting view controller gets traitCollectionDidChange: and if it's horizontal compact then I poke into the presentedViewController->childViewControllers[0].navigationItem.leftBarButtonItem and set it to 'close'. But boy does this feel hacky.
[UPDATE2] So this link helps Close button on adaptive popover but the dismiss button is not then cleared when it switches back out to regular width.
In an iPad master-detail application (the master is an UITableViewController and the detail a QLPreviewController) whenever I present a view controller modally and then dismiss it, the QLPreviewController stops receiving touch events or at least reacting to them. So, it's no longer possible to zoom in or out, or "bouncing" an image/document currently being shown, even after another image/document is selected and shown.
Keep in mind that before presenting the view controller modally everything works as expected and it's possible to zoom in/out.
Anyone knows a possible solution for this weird problem?
EDIT: added that this happens after dismissing the view controller presented modally.
EDIT 2: if the presentation style is UIModalPresentationFormSheet, the problem does not occur. It seems to only occur with UIModalPresentationFullScreen.
Although not a solution for this problem, a workaround is to present the view controller as UIModalPresentationFormSheet instead of fullscreen.
Yes that is expected behaviour.
When a ViewController is presented modally (I assume you are presenting something in a form sheet?), it prevents other view controllers receiving touch events.
The other alternative is to have a look at child view controllers as an alternative; but again, their touch events will take precedence over anything underneath.
I want to modely present a view controller, and during the animation I want to shrink the presenting view controller. I saw a lot of apps doing this effect, its seams that the entire view controller including the navigation bar is shrieked.
I'm not sure how to approach this, and I will really appreciate any help about how to make this kind of effect.
here is an example from the mail app, you can see that when the compose view controller is presented, the other view controller is shrieked behind him:
If this was for iPad I would tell you to simply use an embed segue, or resize your modal container's superview, but since it is for iPhone that makes things trickier. Apple has said that modal presentation for iPhones is always supposed to be the whole screen, so I doubt they did theirs modally. They either made a custom segue type (I'm not sure how to go about doing that), or they simply are using a view and presenting that on the bottom portion of the screen, with a view inside of it to represent the navigation controller.
You can add a different viewController's view to the current view controller then call parentVC addChildViewController: and use it like that. Just use a toolbar instead of a nav bar and it should work fine.
I was looking to do the same and I found this answer by Brian Sachetta that explains how to accomplish it. The link posted in the answer didn't work for me but I found the sample he is talking about here
I am using a third party popover controller on the iphone and have ran across an issue. The one I'm using is WYPopoverController but have tried using FPPopover and it has the same "issue" since they work in a similar way. Here is the deal:
I have a notifications button in my app which pops up a popover controller which contains the notifications feed. It's like the Facebook app. You can see it on the below image.
Now what I want to do it so present a view controller on top of everything and in full screen. The way that popover controller works is that it ads its view directly to the applications main window and its not nested in the view hierarchy so I get a warning saying presenting view controllers on detached view controllers is discouraged and it does not present full screen as well (I know thats logical). If I present it on the parent view controller (the red one in the background) it gets presented below the popover view.
How to fix this?
I was thinking about using a new UIWindow instance and using a root view controller there. Is this an OK solution or is it a hack? If it's ok then how do I accomplish this? I want the presentation and dismissal to be animated :)
I want it to look like Facebok Paper app when you tap an item in the notifications feed.
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;