IPHONEX显示状态栏

写在『UnityViewControllerBase+iOS.MM 』

{
    static bool _PrefersStatusBarHidden = true;

    static bool _PrefersStatusBarHiddenInited = false;
    if (!_PrefersStatusBarHiddenInited)
    {
        NSNumber* hidden = [[[NSBundle mainBundle] infoDictionary] objectForKey: @"UIStatusBarHidden"];
        _PrefersStatusBarHidden = hidden ? [hidden boolValue] : YES;

        _PrefersStatusBarHiddenInited = true;
    }
    
    CGSize result = [[UIScreen mainScreen] bounds].size;
    if(result.width / result.height >= 0.56)
    {
        _PrefersStatusBarHidden = true;
    }
    else
        _PrefersStatusBarHidden = false;
    
    return _PrefersStatusBarHidden;
}

你可能感兴趣的:(IPHONEX显示状态栏)