Disappearing status bar at the top after MPMoviePlayerController is closed

后端 未结 3 821
生来不讨喜
生来不讨喜 2021-02-06 03:23

Having an interesting little problem with my iPhone app. I have a view with a table and each cell, when clicked, plays a video fullscreen then when you press done, the video sto

3条回答
  •  我寻月下人不归
    2021-02-06 04:27

    You can just set the delay to be a float instead. So it would be

    float delay = 0.1;
    
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC), dispatch_get_current_queue(), ^{
            [UIApplication sharedApplication].statusBarHidden = NO;
            [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque;
        });
    

    I had the same problem and solved it by modifying richerd's code a bit. 0.1 second is acceptable imo. I also had to change the status bar style since it returned a BlackTranslucent bar style and the original was BlackOpaque style. But works fine now.

提交回复
热议问题