iOS iPhone X adapter HomeIndicator related practices

1. Hide HomeIndicator generally only full-screen video playback and game interface needs to be set to automatically hide the Home key indicators, hidden HomeIndicator method, as follows,

- (BOOL)prefersHomeIndicatorAutoHidden {
  return YES;
}
复制代码

When the VC inside rewrite prefersHomeIndicatorAutoHidden return to YES (default is NO), Home bar will automatically hide, this method is a callback after the controller will push, if not interactive screen incident response delay of about two seconds will automatically hide . After the test found, the touch of the page will re-appear, does not operate while the page will automatically disappear. Mainly for video etc. for a long time that the page will make use of interactive applications.

2. The screen edge gestures conflict Sometimes you need to control the App drop down from the status bar or on the bottom of the slide bar, this will pull down the notification center with gestures and systems control center on the slide gesture conflict. If you want to deal with their own priorities gesture gesture system may be delayed. Methods as below:

- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures{
    return UIRectEdgeAll;
}
复制代码

Then the rest Do not modify (such as prefersHomeIndicatorAutoHidden); you can as always display IOUs as king of glory, but not to click on a desktop, not to multi-task

PS: My blog address

Guess you like

Origin blog.csdn.net/weixin_34252686/article/details/91397776