当前位置: 首页 > news >正文

领动做的企业网站怎么样怎么判断网站被k

领动做的企业网站怎么样,怎么判断网站被k,上海网站建设与设计,中国建筑培训网iOS开发-启动页广告实现 启动页广告实现是一个非常常见的广告展示模式。 就是在启动时候显示广告#xff0c;之后点击跳转到广告页面或者其他APP。 一、实现启动页广告 启动页广告控件实现#xff0c;将View放置在keyWindow上#xff0c;显示广告图片#xff0c;点击广告…iOS开发-启动页广告实现 启动页广告实现是一个非常常见的广告展示模式。 就是在启动时候显示广告之后点击跳转到广告页面或者其他APP。 一、实现启动页广告 启动页广告控件实现将View放置在keyWindow上显示广告图片点击广告图片进行跳转。 如果没有操作倒计时5s后进行App 具体代码如下 SDFullScreenADView.h #import UIKit/UIKit.h#define kFullScreenAdTag 9012//跳转按钮样式 typedef NS_ENUM(NSUInteger, SDSkipButtonType) {SDSkipButtonTypeText 0, };typedef void(^SDFullScreenADBlock)();interface SDFullScreenADView : UIView/**广告图的显示时间默认5秒*/ property (nonatomic, assign) NSUInteger duration;/**右上角按钮的样式默认倒计时跳过*/ property (nonatomic, assign) SDSkipButtonType skipType;/**广告图*/ property (nonatomic, strong) UIImage *adImage;/**广告数据跳转数据*/ property (nonatomic, strong) id data;property (nonatomic, copy) SDFullScreenADBlock block;/**显示广告*/ - (void)show;/**默认广告return id*/(SDFullScreenADView *)defaultFullScreenADView;endSDFullScreenADView.m #import SDFullScreenADView.h#define kMainScreenWidth [UIScreen mainScreen].bounds.size.widthinterface SDFullScreenADView ()property (nonatomic, strong) UIImageView *adImageView; //广告界面 property (nonatomic, strong) UIButton *skipButton; //跳过按钮 property (nonatomic, strong) UILabel *timeLabel; //倒计时控件property (nonatomic, strong) NSTimer *displayTimer; //剩余时间倒计时endimplementation SDFullScreenADView- (instancetype)init {self [super init];if (self) {[self configDefaultParameter];[self setupSubView];UITapGestureRecognizer *tap [[UITapGestureRecognizer alloc] initWithTarget:self action:selector(adTapAction)];[self addGestureRecognizer:tap];UIWindow *window [UIApplication sharedApplication].keyWindow;if (!window) {return nil;}[window addSubview:self];}return self; }#pragma mark - Private Method - /**配置默认参数*/ - (void)configDefaultParameter {self.duration 5;self.skipType SDSkipButtonTypeText;self.frame [[UIScreen mainScreen] bounds]; }/**设置控件*/ - (void)setupSubView {[self addSubview:self.adImageView];self.adImageView.frame self.bounds;[self addSubview:self.skipButton];self.skipButton.frame CGRectMake(kMainScreenWidth - 80, 30, 70, 30);[self addSubview:self.timeLabel];self.timeLabel.frame self.skipButton.frame; }- (void)setDuration:(NSUInteger)duration {_duration duration; }- (void)setAdImage:(UIImage *)adImage {_adImage adImage; }- (void)adTapAction {[self.displayTimer invalidate];self.displayTimer nil;[self dismiss];if (self.block) {self.block();} }- (void)skipButtonAction {[self dismiss]; }- (void)displayTimerAciton {self.duration--;if (self.duration 0) {[self dismiss];return;}if (self.duration 0) {_timeLabel.text [NSString stringWithFormat:%lus跳过广告,(unsigned long)self.duration];} }/**显示广告*/ - (void)show {if (!self.adImage) {[self removeFromSuperview];return;}[self addDisplayTimer];self.adImageView.image self.adImage;self.alpha 0.0;[UIView animateWithDuration:0.25 delay:0.0 options:UIViewAnimationOptionCurveEaseOut animations:^{self.alpha 1.0;} completion:^(BOOL finished) {}]; }/**消失广告图*/ - (void)dismiss {[UIView animateWithDuration:0.5 delay:0.3 options:UIViewAnimationOptionCurveEaseOut animations:^{self.transform CGAffineTransformMakeScale(1.2, 1.2);self.alpha 0.0;} completion:^(BOOL finished) {[self removeFromSuperview];}]; }#pragma mark - SETTER/GETTER - (UIButton *)skipButton {if (!_skipButton) {_skipButton [UIButton buttonWithType:UIButtonTypeCustom];_skipButton.backgroundColor [UIColor colorWithRed:0 green:0 blue:0 alpha:0.4];_skipButton.layer.cornerRadius 4;_skipButton.layer.masksToBounds YES;_skipButton.titleLabel.font [INSysFont inSysFontOfSize:14];[_skipButton addTarget:self action:selector(skipButtonAction) forControlEvents:UIControlEventTouchUpInside];}return _skipButton; }- (UIImageView *)adImageView {if (!_adImageView) {_adImageView [[UIImageView alloc] initWithFrame:self.bounds];_adImageView.backgroundColor [UIColor clearColor];_adImageView.clipsToBounds YES;_adImageView.contentMode UIViewContentModeScaleAspectFill;}return _adImageView; }- (UILabel *)timeLabel {if (!_timeLabel) {_timeLabel [[UILabel alloc] initWithFrame:CGRectZero];_timeLabel.backgroundColor [UIColor clearColor];_timeLabel.textAlignment NSTextAlignmentCenter;_timeLabel.font [UIFont fontWithName:Heiti SC size:12];_timeLabel.textColor [UIColor whiteColor];_timeLabel.text 跳过广告;}return _timeLabel; }- (void)addDisplayTimer {if (self.displayTimer) {[self.displayTimer invalidate];self.displayTimer nil;}self.displayTimer [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:selector(displayTimerAciton) userInfo:nil repeats:YES];[[NSRunLoop mainRunLoop] addTimer:self.displayTimer forMode:NSRunLoopCommonModes]; }#pragma mark - DEALLOC - (void)dealloc {[self.displayTimer invalidate];self.displayTimer nil; }/**默认广告return id*/(SDFullScreenADView *)defaultFullScreenADView {SDFullScreenADView *fullScreenAdView [[SDFullScreenADView alloc] init];fullScreenAdView.duration 3;fullScreenAdView.tag kFullScreenAdTag;fullScreenAdView.alpha 0.0;return fullScreenAdView; }end二、小结 iOS开发-启动页广告实现 启动页广告实现是一个非常常见的广告展示模式。 就是在启动时候显示广告之后点击跳转到广告页面或者其他APP。 学习记录每天不停进步。
http://www.zqtcl.cn/news/469607/

相关文章:

  • 厦门物流网站建设南京宜电的网站谁做的
  • vps 网站备案手机界面设计素材
  • seo排名影响因素主要有灯塔seo
  • 济南哪家做网站小勇cms网站管理系统
  • sns社交网站注册做网站 提交源码 论坛
  • wordpress网站编辑semir是什么牌子
  • 做区块链的网站教育培训机构平台
  • 系统网站怎么做的seo竞争对手分析
  • 菏泽网站建设菏泽众皓网页开发工资
  • 网站建设需求分析酒类群晖wordpress 映射
  • 呼和浩特网站建设宣传wordpress淘宝客插件开发
  • 如何建网站赚钱做淘宝网店需要多少钱
  • 做个企业网站 优帮云移动商城个人中心手机卡进度查询
  • 深圳建设网站哪家最好国外互联网裁员
  • 网站重新建设的请示wordpress get_terms 排序
  • 建站模板免费下载wordpress 管理地址
  • 静安企业网站制作wordpress文章列表显示缩略图
  • html前端网站开发先做网站还是先解析
  • 怎么通过域名访问网站elision wordpress
  • 做邮轮的网站做游戏的软件app
  • 做网站用php还是python家装十大品牌排行榜
  • 湛江网站建设招聘创作者服务平台
  • 衡阳建网站高中制作网站怎么做
  • 上海网站排名团队推广链接跳转
  • 寻找郑州网站优化公司上海高端网站定制
  • 网站关键词排名优化长城建设投资有限公司网站
  • 网站专题优化电子商务网站运营方案
  • 唐山建网站公司湖南网站制作电话
  • 做神马网站优化合肥城乡建设局官网
  • 网站开发与管理心得体会建设高流量网站