当前位置:网站首页>Liuhaiping's mobile phone passes [[uiapplication sharedapplication] delegate] window. safeAreaInsets. The height of the bottom security zone is 0
Liuhaiping's mobile phone passes [[uiapplication sharedapplication] delegate] window. safeAreaInsets. The height of the bottom security zone is 0
2022-06-28 05:12:00 【Ying Guoshang】
Liuhaiping's mobile phone passes through... On some pages [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom The height of the bottom safety zone is 0 problem , How to solve ?
If we are in the player SelVideoPlayer The height of the safety zone at the bottom of the liuhaiping mobile phone is obtained in 0, My top safety zone is also 0. As such, the following definitions :
#define kMainTopHeight ({
float space = 64.0; if (@available(iOS 11.0, *)) space = ([[UIApplication sharedApplication] delegate].window.safeAreaInsets.top+44); (space); })
#define kMainBottomHeight ({
float space = 49.0; if (@available(iOS 11.0, *)) space = ([[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom + 49); (space); })
The analysis reason should be the problem of the window . Then how to solve it ?
It can be retrieved by keyWindow To find the bottom safety height and the top safety zone height correctly .
#define Base_BottomHeight ([FMConfig config].safeBottomHeight)
// Height of bottom safety zone
#define BR_BOTTOM_MARGIN \ ({
CGFloat safeBottomHeight = 0;\ if (@available(iOS 11.0, *)) {
\ safeBottomHeight = BRGetKeyWindow().safeAreaInsets.bottom;\ }\ (safeBottomHeight);})
/** obtain keyWindow */
static inline UIWindow *BRGetKeyWindow(void) {
UIWindow *keyWindow = nil;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 // Compile time check SDK edition :Xcode11+ Compilation will call (iOS SDK 13.0 Processing of later versions )
if (@available(iOS 13.0, *)) {
NSSet<UIScene *> *connectedScenes = [UIApplication sharedApplication].connectedScenes;
for (UIScene *scene in connectedScenes) {
if (scene.activationState == UISceneActivationStateForegroundActive && [scene isKindOfClass:[UIWindowScene class]]) {
UIWindowScene *windowScene = (UIWindowScene *)scene;
for (UIWindow *window in windowScene.windows) {
if (window.isKeyWindow) {
keyWindow = window;
break;
}
}
}
}
} else
#endif
{
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 130000
return [UIApplication sharedApplication].keyWindow;
#endif
}
return keyWindow;
}
边栏推荐
- Assembly common instructions
- 交流电和直流电的区别是什么?
- Opencv实现颜色检测
- IP datagram sending and forwarding process
- The heading angle of sliceplane is the same as that of math Corresponding transformation relation of atan2 (y, x)
- 店铺进销存管理系统源码
- Distributed transaction - Final consistency scheme based on message compensation (local message table, message queue)
- 2022 safety officer-b certificate examination question bank and answers
- [microservices openfeign] openfeign quick start service invocation based on feign
- 摄像头基础知识
猜你喜欢

2022 low voltage electrician examination questions and answers

Amino dye research: lumiprobe fam amine, 6-isomer

开关电源电压型与电流型控制

PCR/qPCR研究:Lumiprobe丨dsGreen 用于实时 PCR

2022 safety officer-b certificate examination question bank and answers

2022年G3锅炉水处理复训题库模拟考试平台操作

2022 high altitude installation, maintenance and removal examination questions and answers

氨基染料研究:Lumiprobe FAM 胺,6-异构体

如何学习可编程逻辑控制器(PLC)?

Don't roll! How to reproduce a paper with high quality?
随机推荐
mysql 导出查询结果成 excel 文件
活性染料研究:Lumiprobe AF594 NHS 酯,5-异构体
How long will the PMP test results come out? You must know this!
SlicePlane的Heading角度与Math.atan2(y,x)的对应转换关系
The latest examination questions and answers for the eight members (standard members) of Liaoning architecture in 2022
Light collector, Yunnan Baiyao!
JS 文本框失去焦点修改全半角文字和符号
lotus v1.16.0 calibnet
Organize the online cake mall project
Operation of simulated examination platform of G3 boiler water treatment recurrent training question bank in 2022
交流电和直流电的区别是什么?
整理网上蛋糕商城项目
Biovendor sRAGE protein solution
[JVM series] JVM tuning
IP datagram sending and forwarding process
2022年材料员-通用基础(材料员)操作证考试题库及答案
Performance optimization and implementation of video codec
羧酸研究:Lumiprobe 磺基花青7二羧酸
mysql导出数据库字典成excel文件
二级造价工程师考试还没完?还有资格审核规定!