美文网首页
APP倒计时启动海报/启动广告

APP倒计时启动海报/启动广告

作者: 没错就是豪哥灬 | 来源:发表于2022-04-29 16:17 被阅读0次

1.appdelegate里面 设置window.rootVC为需要显示的海报/广告vc

LaunchADVC * vc = [[LaunchADVC alloc] init];

BaseNavigationController *vcNav = [[BaseNavigationController alloc] initWithRootViewController:vc];

self.window.rootViewController = vcNav;

2.launchADVC里画一个imageview

_adIV = [UIImageView new];

    _adIV.contentMode = UIViewContentModeScaleAspectFill;

    _adIV.clipsToBounds = YES;

2.1可以海报未加载出来时,先显示LaunchScreen里的图片,这样就可以使启动图与海报无缝衔接.

_placeholderIV = [UIImageView new];

    _placeholderIV.contentMode = UIViewContentModeScaleAspectFill;

    _placeholderIV.image = [self getLaunchScreenImg];

    [self.containerView addSubview:self.placeholderIV];

    [self.placeholderIV mas_makeConstraints:^(MASConstraintMaker *make) {

        make.top.left.right.bottom.mas_equalTo(self.containerView).offset(0);

    }];

-(UIImage *)getLaunchScreenImg

{

    UIViewController * vc = [[UIStoryboard storyboardWithName:@"LaunchScreen" bundle:[NSBundle mainBundle]] instantiateInitialViewController];

    CGRect rect = [UIScreen mainScreen].bounds;

    UIGraphicsBeginImageContextWithOptions(rect.size, YES, 0.0f);

    CGContextRef context = UIGraphicsGetCurrentContext();

    vc.view.frame= rect;

    [vc.view.layer renderInContext:context];

    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

    return image;

}

[self.adIVsd_setImageWithURL:[NSURLURLWithString:resultDict[@"image_url"]]completed:^(UIImage*_Nullableimage,NSError*_Nullableerror,SDImageCacheTypecacheType,NSURL*_NullableimageURL)

                 {

                    self.placeholderIV.hidden=YES;

                    [self->_timerBtnstartTimer:5countDownBlock:^(boolisEnd) {

                        if(isEnd)

                        {

                            [selftimerBtnClick];

                        }

                    }];

                }];

3.后端设置上传的图片尺寸为1240*2208   ,要求设计图片的时候安全区域居中且尺寸为1100*2000(改尺寸并固定,可增宽增高) ,图片上需要显示的内容不要超出安全区域,不然有被裁剪掉的风险.

相关文章

  • APP倒计时启动海报/启动广告

    1.appdelegate里面 设置window.rootVC为需要显示的海报/广告vc LaunchADVC *...

  • App广告管理

    需求 首次启动广告 热启动广告(App进入后台后,再次进入前台) 热启动时间间隔控制 (App在后台的时间) 每次...

  • iOS造轮子之启动广告页

    这个小轮子 也是app 中非常常见的需求启动app 会展示广告页 可以跳过 或者等待倒计时结束 可以展示 全屏 也...

  • iOS 自定义APP启动页

    现在大部分APP都会有一个倒计时启动页,用来展示广告,分享一种实现方式,原理其实很简单,就是在程序启动时从后台请求...

  • App启动页优化

    功能:启动页展示logo和服务器配置的广告图 app启动方式 冷启动问题 给启动页设置布局,logo闪现问题

  • iOS app启动优化方案

    一、APP的启动 二、App启动阶段 APP的启动 - dyld APP的启动 - runtime APP的启动 ...

  • iOS 实现有效延时启动页

      目前国内App有这样的需要:在App启动的时候加定时广告,为增加曝光度多显示几秒的启动页。但是系统默认启动页显...

  • Android 启动页

    因为现在大部分APP启动的时候,app第一屏是广告,需要启动时通过网络下载,所以一般都需要给APP设置一个启动页来...

  • iOS启动广告设计与实现

    购物类app、微博、手机百度 打开app的时候经常会出现启动广告。 这个启动广告如何做的呢? 更新机制是什么? 图...

  • iOS启动广告页展示

    iOS启动广告页展示 现在很多主流App如:淘宝、美团等在启动过程中都会展示广告页。在这些流量巨大的App中展示广...

网友评论

      本文标题:APP倒计时启动海报/启动广告

      本文链接:https://www.haomeiwen.com/subject/ezpsyrtx.html