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

后端 未结 4 2004
再見小時候
再見小時候 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:26

    I know the OP was looking for a way to cover the navigation bar totally, but instead of covering it, you could just temporarily hide it. Once hidden, you can add you view as a subView and change its frame or constraints so it takes up the whole screen.

    - (void)showViewOverNavBar:(UIView *)view {
    
        [self.navigationController setNavigationBarHidden:YES];
        [self.view addSubview:view];
    }
    

提交回复
热议问题