diff --git a/ios/Hera/Page/Views/WDHTabBarViewController.m b/ios/Hera/Page/Views/WDHTabBarViewController.m index ca8f099..54cc08f 100755 --- a/ios/Hera/Page/Views/WDHTabBarViewController.m +++ b/ios/Hera/Page/Views/WDHTabBarViewController.m @@ -94,7 +94,7 @@ - (void)viewDidLayoutSubviews{ tabbarFrame = (CGRect){0,naviHeight,w,49}; }else { CGFloat tabbarHeight = IS_IPHONE_X ? 83 : 49; - tabbarFrame = (CGRect){0,h - self.tabbar.wdh_view.bounds.size.height,w,tabbarHeight}; + tabbarFrame = (CGRect){0,h - tabbarHeight,w,tabbarHeight}; } self.tabbar.wdh_view.frame = tabbarFrame; diff --git a/ios/Hera/Tools/WDHDeviceMacro.h b/ios/Hera/Tools/WDHDeviceMacro.h index b563252..409a926 100644 --- a/ios/Hera/Tools/WDHDeviceMacro.h +++ b/ios/Hera/Tools/WDHDeviceMacro.h @@ -34,7 +34,8 @@ #define IS_IPHONE_6 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 667.0) #define IS_IPHONE_6PLUS (IS_IPHONE && [[UIScreen mainScreen] nativeScale] == 3.0f) #define IS_IPHONE_6_PLUS (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 736.0) -#define IS_IPHONE_X (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 812.0) +#define IS_IOS_11 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.f) +#define IS_IPHONE_X (IS_IOS_11 && IS_IPHONE && (MIN([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) >= 375 && MAX([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) >= 812)) #endif /* WDHDeviceMacro_h */