iPhone-X - How to force user to swipe twice home indicator to go home-screen

前端 未结 4 1561
醉话见心
醉话见心 2021-02-05 17:55

I\'m using the code below to hide the home indicator on iPhone X, which is working fine in the emulator.

-(BOOL)prefersHomeIndicatorAutoHidden
{
    return YES;
         


        
4条回答
  •  一生所求
    2021-02-05 18:23

    I had the same problem.

    PrefersHomeIndicatorAutoHidden must return NO but also PreferredScreenEdgesDeferringSystemGestures must be overridden and return UIRectEdgeBottom.

    Swift 4.2

    override var prefersHomeIndicatorAutoHidden: Bool {
      return false
    }
    
    override var preferredScreenEdgesDeferringSystemGestures: UIRectEdge {
      return UIRectEdge.bottom
    }
    

提交回复
热议问题