Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 8 popoverpresentationcontroller popoverlayoutmargin not working

Tags:

I am using the new popOverPresentationController to present UIPopOverController in iOS 8. I set the popOverLayoutMargins with a value like {65.0, 10.0, 45.0, 10.0}. But these do not reflect when I present the popOverController. This used to work perfectly on iOS 7. Is this broken on ios 8?

Regards, Harikant Jammi

like image 477
Harikant Jammi Avatar asked Sep 25 '14 11:09

Harikant Jammi


People also ask

Is uipopovercontroller deprecated in iOS 9?

Since iOS 9, UIPopoverController is deprecated. Time to look at UIPopoverPresentationController, which has been introduced in iOS 8. Presenting a controller as a popover is very straightforward with UIPopoverPresentationController.

What is a popover presentation controller?

A popover presentation controller notifies your delegate at appropriate points during the presentation process. You can use the delegate methods to customize this process and respond to changes dynamically. The margins that define the portion of the screen in which it is permissible to display the popover.

How do I manage the Popover presentation in UIKit?

From the time a popover is presented until the time it is dismissed, UIKit uses an instance of this class to manage the presentation behavior. You use instances of this class as-is to configure aspects of the popover appearance and behavior for view controllers whose presentation style is set to UIModalPresentationStyle.popover.

How do I present a popover on the iPhone?

In the default configuration the popover is presented as a modal view controller on the iPhone. However, if you return UIModalPresentationStyle.None in the adaptivePresentationStyleForPresentationController method of the UIPopoverPresentationControllerDelegate , you can present a popover also on the iPhone.


Video Answer


1 Answers

It is an Apple bug which has not yet been fixed. References to the bug can be found in this example code and on the Apple developer forums.

There is currently no clear workaround for this issue. A bug report with ID 18392444 has been filed with Apple.

like image 99
Oleg Gordiichuk Avatar answered Nov 08 '22 08:11

Oleg Gordiichuk