美文网首页iOS-SDK开发
iPhone 14 Pro系列导航栏适配高度(灵动岛)

iPhone 14 Pro系列导航栏适配高度(灵动岛)

作者: 笨的很想飞 | 来源:发表于2023-04-12 15:04 被阅读0次
    //获取状态栏的高度
    +(int)kStatusBarHeight{
     
        CGFloat statusBarHeight = 0;
        if(@available(iOS 13.0, *)){
            UIWindow *window = UIApplication.sharedApplication.windows.firstObject;
            CGFloat topPadding = window.safeAreaInsets.top;
            if(topPadding >0){
                statusBarHeight = topPadding;
            }else{
                statusBarHeight = 20;
            }
        } else {
            statusBarHeight = UIApplication.sharedApplication.statusBarFrame.size.height;
        }
        return statusBarHeight + 44;
    }
    

    相关文章

      网友评论

        本文标题:iPhone 14 Pro系列导航栏适配高度(灵动岛)

        本文链接:https://www.haomeiwen.com/subject/crhoddtx.html