UIPopoverController does not respect RECT parameter when UIPopoverArrowDirectionUp is used and preferredContentSize exceeds the available height
| Originator: | labor.lg | ||
| Number: | rdar://21873361 | Date Originated: | July 17, 2015 |
| Status: | Open | Resolved: | |
| Product: | iPad | Product Version: | iOS9 |
| Classification: | UI Bug | Reproducible: | 100% |
When a UIPopoverController is presented using the following API: presentPopoverFromRect:inView:animated on iOS8 the preferredContentSize of the UIViewController that is contained in the UIPopoverController will be modified to allow it to fit inside the available space, whereby the available space is determined by the keyboard and the edges of the screen. This means that the "rect" parameter will be respected and the UIPopoverController will be drawn such that it has a size may not be the preferredContentSize but will have the arrow drawn into the rect. on iOS9 this is not done and the rect parameter is completely ignored if the preferredContentSize is higher than the available space. In particular if the "height" parameter of the preferredContentSize is greater than the height to the keyboard or the bottom of the screen then the UIPopverController does not have the arrow pointing to the specified rect. Instead it's drawn at some random position covering other UI. Steps to Reproduce: Create an iPad app that has a button. Attach code to the button that creates a UITableViewController and make that table view controller the content controller for a UIPopverController. Create the UIPopoverController and give the UITableViewController a preferred height that would cause it to be lower than the edge of the screen or the top edge of the keyboard if that's showing. Call presentPopoverFromRect:fromView:animated, passing in the bounds of the button, the button and YES/NO as the parameters. Expected Results: The UIPopoverController should be drawn such that the arrow points to the specified rect. Actual Results: The UIPopoverController is drawn with the arrow pointing to some random place higher than the rect. Note the X value of the arrow is valid, the Y value is wrong. Version: iOS9 Notes: I've provided screenshots on iOS8 and IOS9 for this bug, as well as the sample project. Run the sample project on IOS8, then run it on iOS9 and compare the results. Note that the arrow is drawn in the wrong place on iOS9.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!