IPhone - After dismissing Modal View Controller - gap is left at top of page

后端 未结 16 969
暖寄归人
暖寄归人 2020-12-24 07:07

When starting the app, if the user doesn\'t have login information stored, I want to display a modal view controller to force the entry of this information. I found through

16条回答
  •  执笔经年
    2020-12-24 07:53

    For me, my modal view controller was a MoviePlayer and when it would be presented, it seemed that the status bar would be redrawn. When the view was dismissed, this second status bar would somehow create a 20px offset at the bottom of my screen, just above the tabbar controller.

    To fix this, when the modal view controller was presented, I would hide the status bar. When the movie had finished playing and the modal view controller was going to be dismissed, I made the status bar visible.

    - (void) moviePlayerLoadStateChanged:(NSNotification*)notification 
    {
    [[UIApplication sharedApplication] setStatusBarHidden:YES];
    }
    
    
    - (void) moviePlayBackDidFinish:(NSNotification*)notification 
    {
    [[UIApplication sharedApplication] setStatusBarHidden:NO];
    }
    

提交回复
热议问题