UINavigationController content offset when displayed in UIPopover

I have a view that I upload to the UINavigationController and present it either as a popover on the iPad or a modal view on the iPhone.

The strangeness I came across is that when this navigator is presented in a popover, the content gets shifted or shifted down by about 60 pixels. Below are screenshots of this phenomenon.

enter image description here

Currently, it looks like this because I have my limit of 80 to compensate for the iPhone. If I set it to something more intuitive, like 10 or 20, the shortcut will be completely hidden under the iPhone navigation bar, while the popover will look right.

Any suggestion? I know that I can manually adjust the upper limit based on whether it is modal or popover, but I would prefer to change some property on the navigation bar to disable the offset or something like that, since using device idioms is no longer Approved by Apple :(

Thanks in advance.

0
source share
1 answer

Try setting the StoryBoard tab to Configure Scrolling in View Mode and check the Advanced Faces settings . UIViewController settings

@property(nonatomic,assign) BOOL automaticallyAdjustsScrollViewInsets NS_AVAILABLE_IOS(7_0); // Defaults to YES
@property(nonatomic,assign) UIRectEdge edgesForExtendedLayout NS_AVAILABLE_IOS(7_0); // Defaults to UIRectEdgeAll
@property(nonatomic,assign) BOOL extendedLayoutIncludesOpaqueBars NS_AVAILABLE_IOS(7_0); // Defaults to NO, but bars are 
+2
source

Source: https://habr.com/ru/post/1620238/


All Articles