Add a UIView above all, even the navigation bar

前端 未结 17 1693
悲&欢浪女
悲&欢浪女 2020-11-29 15:36

I want to display, above any other views, even the navigation bar, a kind of \"pop-up\" view that looks like this:

  • full screen black background with a 0.5 alph
17条回答
  •  感动是毒
    2020-11-29 15:58

    Here is a simple elegant solution that is working for me. You can set the z position of the navigation bar to below the view:

    self.navigationController.navigationBar.layer.zPosition = -1;
    

    Just remember to set it back to 0 when done.

提交回复
热议问题