其他分享
首页 > 其他分享> > OC Control AdvertiseGradient(启动广告图)

OC Control AdvertiseGradient(启动广告图)

作者:互联网

一直觉得自己写的不是技术,而是情怀,一个个的教程是自己这一路走来的痕迹。靠专业技能的成功是最具可复制性的,希望我的这条路能让你们少走弯路,希望我能帮你们抹去知识的蒙尘,希望我能帮你们理清知识的脉络,希望未来技术之巅上有你们也有我。

今天是2021年春节 初一 祝大家春节快乐

在这里插入图片描述

效果

在这里插入图片描述

使用

[AdvertiseGradientNSObject initAdvertise:@[@“https://xxx.xxx.com/static/images/welcome.jpg”]];

广告封装3: 只是一张图片,不能点进控制器里面
  //动态修改启动页
  UIImageView *icon = [UIImageView new];
  [icon sd_setImageWithURL:[NSURL URLWithString:@"https://xx.xxx.com/static/images/welcome.jpg"] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
    //如果有图片存在
    if (icon) {
      //初始化一个imageView,并添加到window上
      UIImageView *imgView = [[UIImageView alloc]initWithFrame:[UIApplication sharedApplication].keyWindow.bounds];
      imgView.image = image;
      [self.window addSubview:imgView];
      dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [UIView animateWithDuration:3 animations:^{
          imgView.transform = CGAffineTransformMakeScale(1.4,1.4);
          imgView.alpha =0.0;
        } completion:^(BOOL finished) {
          [imgView removeFromSuperview];
        }];
      });
    }
  }];

标签:Control,Nullable,image,xxx,OC,UIImageView,dispatch,imgView,AdvertiseGradient
来源: https://blog.csdn.net/weixin_38716347/article/details/113795879