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

修复在 iPhone 12 系列下,跳过按钮位置不准确的问题 #235

Open
wants to merge 1 commit into
base: master
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 XHLaunchAd/XHLaunchAd/XHLaunchAdButton.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ - (instancetype)initWithSkipType:(SkipType)skipType{
if (self) {

_skipType = skipType;
CGFloat y = XH_FULLSCREEN ? 44 : 20;
CGFloat y = XH_SAFEAREAINSETS.top;
self.frame = CGRectMake(XH_ScreenW-80,y, 70, 35);//方形
switch (skipType) {
case SkipTypeRoundTime:
Expand Down
1 change: 1 addition & 0 deletions XHLaunchAd/XHLaunchAd/XHLaunchAdConst.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define XH_IPHONEXSMAX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) : NO)
#define XH_FULLSCREEN ((XH_IPHONEX || XH_IPHONEXR || XH_IPHONEXSMAX) ? YES : NO)

#define XH_SAFEAREAINSETS ((([[UIDevice currentDevice].systemVersion floatValue] >= 11) && [UIApplication sharedApplication].keyWindow.safeAreaInsets.top >= 44) ? [UIApplication sharedApplication].keyWindow.safeAreaInsets : UIEdgeInsetsMake(20, 0, 0, 0))

#define XHISURLString(string) ([string hasPrefix:@"https://"] || [string hasPrefix:@"http://"]) ? YES:NO
#define XHStringContainsSubString(string,subString) ([string rangeOfString:subString].location == NSNotFound) ? NO:YES
Expand Down