search

Home  >  Q&A  >  body text

objective-c - ios 关于弹出的视图把最顶部的导航栏都遮盖掉 且能滑动返回

如题 遮盖掉
一般我能想到的只有3中方式

  1. 直接用一个全屏view加到window上面。

  2. 模态出一个controller。

  3. 当前controller addChildViewController也可以。

但是这些都无法满足滑动返回,因为都不是加在当前的view上所以无法在当前视图实现滑动返回,有没有人知道这种该如何实现?

PHP中文网PHP中文网2812 days ago705

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-18 09:08:41

    I have solved it. Let me talk about it here. You can first set the transparency of the navigation bar to 0 in viewWillAppear and set the transparency of the navigation bar to 1 in viewWillDisappear. The height and width of the view will be full screen. This will solve the problem

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-18 09:08:41

    Just hide the navigationBar

    Call in viewWillAppear

    [self.navigationController setNavigationBarHidden:YES animated:YES];
    

    But there is a problem with sliding back at this time
    Call in viewDidLoad

    self.navigationController.interactivePopGestureRecognizer.delegate = (id<UIGestureRecognizerDelegate>)self;
    

    Just add a return button yourself

    reply
    0
  • Cancelreply