Skip to content

Commit

Permalink
适配iPhoneX weidian-inc#49
Browse files Browse the repository at this point in the history
  • Loading branch information
gzuliyujiang committed Nov 24, 2020
1 parent d29ceb6 commit 9b066cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ios/Hera/Page/Views/WDHTabBarViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions ios/Hera/Tools/WDHDeviceMacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +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 */

0 comments on commit 9b066cd

Please sign in to comment.