fix status bar height in call view for iphoneX, XR and XS

This commit is contained in:
Danmei Chen 2019-07-09 17:38:32 +02:00
parent b2513d760a
commit 60fba52521
3 changed files with 7 additions and 6 deletions

View file

@ -392,10 +392,6 @@
return UIInterfaceOrientationPortrait;
}
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_IPHONE_X (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height >= 812.0)
#define IPHONE_STATUSBAR_HEIGHT (IS_IPHONE_X ? 35 : 20)
- (void)update:(UICompositeViewDescription *)description
tabBar:(NSNumber *)tabBar
statusBar:(NSNumber *)statusBar
@ -577,7 +573,7 @@
// Compute frame for each elements
CGRect viewFrame = self.view.frame;
int origin = currentViewDescription.fullscreen ? 0 : IPHONE_STATUSBAR_HEIGHT;
int origin = currentViewDescription.fullscreen ? 0 : [PhoneMainView iphoneStatusBarHeight];
// 1. status bar - fixed size on top

View file

@ -119,6 +119,7 @@
+ (PhoneMainView*) instance;
- (BOOL)isIphoneXDevice;
+ (int)iphoneStatusBarHeight;
@end

View file

@ -208,13 +208,17 @@ static RootViewManager *rootViewManagerInstance = nil;
/* IPHONE X specific : hide the HomeIndcator when not used */
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_IPHONE_X (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 812.0)
#define IS_IPHONE_X (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height >= 812.0)
#define IPHONE_STATUSBAR_HEIGHT (IS_IPHONE_X ? 35 : 20)
- (BOOL)isIphoneXDevice{
return IS_IPHONE_X;
}
+ (int)iphoneStatusBarHeight{
return IPHONE_STATUSBAR_HEIGHT;
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
if([self isIphoneXDevice]){