uipopover

UIPopoverPresentationController displaying popover as full screen

馋奶兔 提交于 2019-12-03 04:43:40
问题 I am trying to use UIPopoverPresentationController to display a popover that doesn't take up the whole screen. I've followed many different tutorials with no luck. Here is my code. It correctly instantiates the ViewController , but it takes up the entire screen instead of just a smaller screen as I defined in preferredContentSize . func showPopover() { let vc = self.storyboard?.instantiateViewControllerWithIdentifier("PopupTimePickerViewController") as PopupTimePickerViewController vc

How to make UIPopoverController keep same position after rotating?

佐手、 提交于 2019-12-02 15:55:08
I can't keep popover the same position on the screen after rotation. Is there any good way to do that, because just setting some frame to popover works terrible after rotating. popover.frame = CGRectMake(someFrame); After rotation popover looks fine only if it is in the center of the screen. Max MacLeod Apple has a Q&A on exactly this issue. You can find the details here: Technical Q&A QA1694 Handling Popover Controllers During Orientation Changes Basically, the technique explains that in your view controller's didRotateFromInterfaceOrientation method, you will present the pop over again as

How to detect when a popover is dismissed in iOS 9

怎甘沉沦 提交于 2019-12-01 14:20:08
问题 I'm updating an app to use universal storyboards. I've created a popover segue to a new viewcontroller using interface builder by dragging from a button to my new viewcontroller and selecting 'Present As Popover' as the kind of segue. When the user presses outside of the popover (dismissing it) I need to be notified in the presenting view controller so I can undo their actions. How can I do this? Normally I would have created the popover manually and made my viewcontroller the popover's

Stop UIPopover from dismissing automatically

本小妞迷上赌 提交于 2019-11-29 12:23:11
问题 I was wondering if there was a way to stop an iPad popover from dismissing automatically whenever you touch the screen outside the popover? If not, is there some kind of method similar to "popoverDidDismiss" that I could call to tell when the popover was dismissed? 回答1: Yes you can. This is right out of the Apple documentation. When a popover is dismissed due to user taps outside the popover view, the popover automatically notifies its delegate of the action. If you provide a delegate, you

How to present popover properly in iOS 8

折月煮酒 提交于 2019-11-26 15:37:08
I'm trying to add a UIPopoverView to my Swift iOS 8 app, but I am unable to access the PopoverContentSize property, as the popover does not show in the correct shape. my code: var popover: UIPopoverController? = nil func addCategory() { var newCategory = storyboard.instantiateViewControllerWithIdentifier("NewCategory") as UIViewController var nav = UINavigationController(rootViewController: newCategory) popover = UIPopoverController(contentViewController: nav) popover!.setPopoverContentSize(CGSizeMake(550, 600), animated: true) popover!.delegate = self popover!.presentPopoverFromBarButtonItem

UIPopoverPresentationController on iOS 8 iPhone

老子叫甜甜 提交于 2019-11-26 11:16:05
Does anyone know if UIPopoverPresentationController can be used to present popovers on iPhones? Wondering if Apple added this feature on iOS 8 in their attempt to create a more unified presentation controllers for iPad and iPhone. Not sure if its OK to ask/answer questions from Beta. I will remove it in that case. Ivan Choo You can override the default adaptive behaviour ( UIModalPresentationFullScreen in compact horizontal environment, i.e. iPhone) using the adaptivePresentationStyleForPresentationController: method available through UIPopoverPresentationController.delegate .

How to present popover properly in iOS 8

这一生的挚爱 提交于 2019-11-26 04:05:23
问题 I\'m trying to add a UIPopoverView to my Swift iOS 8 app, but I am unable to access the PopoverContentSize property, as the popover does not show in the correct shape. my code: var popover: UIPopoverController? = nil func addCategory() { var newCategory = storyboard.instantiateViewControllerWithIdentifier(\"NewCategory\") as UIViewController var nav = UINavigationController(rootViewController: newCategory) popover = UIPopoverController(contentViewController: nav) popover!