UIModalPresentationPopover - arrow direction Up, Prevent Contentview from starting from tip of the arrow
Asked Answered
F

3

6

in iOS 13 it happens that the view of UIViewcontroller that is presented as model starts from the tip of the arrow. Because of it top banners in all of my popover gets cut. Can I prevent this from happening ? I want that my UIView does not start from arrow but once arrow is finished. The Red view must start from bottom of arrow

Feeze answered 12/8, 2019 at 7:42 Comment(0)
B
2

To fix this issue, I opened up my view controller's XIB, selected the top-most view, and then checked "Use Safe Area Layout Guides" under the File Inspector. Then I added Auto Layout constraints (of length 0) around that view's sole subview (a UITableView).

(I also needed to update the view controller's background colour. This changed the arrow colour back to what it was in iOS 12 and before.)

Background: https://forums.developer.apple.com/thread/122703

Bashee answered 18/9, 2019 at 15:17 Comment(2)
Can you share your code for the auto layout contraints as it's impossible to do these in IB when using a UITableViewControllerHynes
@Hynes In my case, I wasn't using a UITableViewController. Just a UITableView in the root view. The constraints were set between the table view and the surrounding safe area ("Align Trailing to: Safe Area," "Align Top to: Safe Area," etc.)Bashee
L
0

I don't know why they changed this behavior, it can be a pita to deal with it if you are not using xibs. I couldn't find anything in the docs about it.

Use the safe areas to adjust the position of your view. You can both try to extend the size of that red area, or skip the arrow completely. In this particular case you can use safeAreaInsets.top if the arrow is going to be on the top always.

Laminous answered 23/8, 2019 at 6:20 Comment(0)
T
0

I wonder if your contentView contains UIScrollView. If yes, please add alwaysBounceVertical = YES to your scrollView. It works in my case.

Turkmen answered 13/9, 2019 at 10:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.