Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

适配iPhoneX #49

Open
wants to merge 1 commit into
base: master-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 2 additions & 1 deletion ios/Hera/Tools/WDHDeviceMacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down