CoderZhuXH / XHLaunchAd

🔥The screen opening advertising solutions - 开屏广告、启动广告解决方案-支持静态/动态图片广告,mp4视频广告,全屏/半屏广告、兼容iPhone/iPad. 【 Github下载不了/下载慢 可以访问国内下载地址: https://gitee.com/CoderZhuXH/XHLaunchAd】
MIT License
3.69k stars 739 forks source link

iOS 12 模拟器 跳过按钮位置不对 + 点击无效 #234

Open 295060456 opened 4 years ago

huangrun commented 4 years ago

+1

huangrun commented 4 years ago

由于没有提供外部方法修改frame,只有修改源码了,把里面的判断全面屏的宏修改一下就可以了

295060456 commented 4 years ago

怎么改 改哪里 我做会伸手党行不行

huangrun commented 4 years ago

修改XH_FULLSCREEN这个宏,方法很多,如增加iPhone12系列的分辨率,或者改成下面这个 if (@available(iOS 11.0, *)) {\ isPhoneX = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;\ }\ (isPhoneX);})

295060456 commented 4 years ago

define XH_IPHONEX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)

define XH_IPHONEXR ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) : NO)

define XH_IPHONEXSMAX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) : NO)

define XH_IPHONE12 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1080, 2340), [[UIScreen mainScreen] currentMode].size) : NO)

define XH_IPHONE12MAX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1170, 2532), [[UIScreen mainScreen] currentMode].size) : NO)

define XH_IPHONE12PRO ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1170, 2532), [[UIScreen mainScreen] currentMode].size) : NO)

define XH_IPHONE12PROMAX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1284, 2778), [[UIScreen mainScreen] currentMode].size) : NO)

define XH_FULLSCREEN ((XH_IPHONEX || XH_IPHONEXR || XH_IPHONEXSMAX || XH_IPHONE12 || XH_IPHONE12MAX || XH_IPHONE12PRO || XH_IPHONE12PROMAX) ? YES : NO)

Yishuhong commented 3 years ago

define XH_IPHONEX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)

define XH_IPHONEXR ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) : NO)

define XH_IPHONEXSMAX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) : NO)

define XH_IPHONE12 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1080, 2340), [[UIScreen mainScreen] currentMode].size) : NO)

define XH_IPHONE12MAX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1170, 2532), [[UIScreen mainScreen] currentMode].size) : NO)

define XH_IPHONE12PRO ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1170, 2532), [[UIScreen mainScreen] currentMode].size) : NO)

define XH_IPHONE12PROMAX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1284, 2778), [[UIScreen mainScreen] currentMode].size) : NO)

define XH_FULLSCREEN ((XH_IPHONEX || XH_IPHONEXR || XH_IPHONEXSMAX || XH_IPHONE12 || XH_IPHONE12MAX || XH_IPHONE12PRO || XH_IPHONE12PROMAX) ? YES : NO)

能不能把这个更新一下,用cocopods导入的不好处理一update代码就没了

0gsc0 commented 3 years ago

作者本身的意图是想在状态栏下放跳过按钮。所以在XHLaunchAdButton.m 中的initWithSkipType方法中直接修改代码即可。 CGFloat y = 0; if (@available(iOS 13.0, *)) { y = UIApplication.sharedApplication.keyWindow.windowScene.statusBarManager.statusBarFrame.size.height; } else { // Fallback on earlier versions y = UIApplication.sharedApplication.statusBarFrame.size.height; } self.frame = CGRectMake(XH_ScreenW-80,y, 70, 35);//方形

SomeZoo commented 3 years ago

作者不打算处理一下吗