How to make a UIView that can cover the navigation bar?

后端 未结 4 2015
再見小時候
再見小時候 2021-02-19 07:47

I want to show the UIView in full screen, but show the status bar, other things, like the navigation bar need to cover by the UIView.

4条回答
  •  佛祖请我去吃肉
    2021-02-19 08:28

    Struggling a little to fully understand the question, but I think you're asking how you can display a UIView above another view (so that the view with the navigation controls is completely hidden by the second view)?

    UIViewController has:

    - (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated
    

    It would be wise to have your second view managed by a UIViewController, too. For the sake of example let's say your view with the navigation bar is managed by UINavigationViewController, and the view you want to display is managed by otherViewController...

    [navigationViewController presentModalViewController:otherViewController animated:YES];
    

提交回复
热议问题