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

外贸网站服务商/网络营销策略优化

外贸网站服务商,网络营销策略优化,阿里巴巴b2b运营模式,深圳宝安区有几个镇首先看效果图如上 核心代码 实践了苹果cell 重用思想,支持轮播单个view的重用 ,同一个轮播组件支持展示不同的view, ///刷新 - (void)reloadDataAndStartRoll {[self stopTimer];[self layoutCurrentCellAndWillShowCell];NSInteger count …

请添加图片描述
首先看效果图如上
核心代码

实践了苹果cell 重用思想,支持轮播单个view的重用
,同一个轮播组件支持展示不同的view,

///刷新
- (void)reloadDataAndStartRoll
{[self stopTimer];[self layoutCurrentCellAndWillShowCell];NSInteger count = [self.dataSource numberOfRowsForRollingNoticeView:self];if (count && count < 2) {return;}__weak typeof(self) weakSelf = self;self.timer = [NSTimer timerWithTimeInterval:self.stayInterval + self.animationDuration repeats:YES block:^(NSTimer * _Nonnull timer) {[weakSelf timerHandle];}];NSRunLoop *runLoop = [NSRunLoop currentRunLoop];[runLoop addTimer:self.timer forMode:NSRunLoopCommonModes];
}
///计时器响应方法
- (void)fadeTimeHandler
{self.isRefresing = NO;float w = self.frame.size.width;float h = self.frame.size.height;self.isAnimating = YES;[self.reuseCells removeObject:_currentCell];[self.reuseCells removeObject:_willShowCell];///动画隐藏当前的cell[UIView animateWithDuration:self.animationDuration delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{if (self.isRefresing) {self.currentCell.alpha = 1;} else {self.currentCell.alpha = 0;}} completion:^(BOOL finished) {}];[UIView animateWithDuration:self.animationDuration - 0.1 delay:0.1 options:UIViewAnimationOptionCurveLinear animations:^{if (self.isRefresing) {self.currentCell.frame = CGRectMake(0, 0, w, h);} else {self.currentCell.frame = CGRectMake(0, - self.fadeTranslationY, w, h);}} completion:^(BOOL finished) {}];///动画展示下一个cell ,/*这里减0.07是需要在上面文案的动画还没有结束的时候,下面文案的动画就要开始了*/dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)((self.animationDuration - 0.07) * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{[self showNext];});
}
///展示下一条
- (void)showNext
{[UIView animateWithDuration:self.animationDuration animations:^{if (self.isRefresing) {self.willShowCell.alpha = 0;} else {self.willShowCell.alpha = 1;}} completion:^(BOOL finished) {}] ;float w = self.frame.size.width;float h = self.frame.size.height;[UIView animateWithDuration:self.animationDuration - 0.1 delay:0.1 options:UIViewAnimationOptionCurveLinear animations:^{if (self.isRefresing) {self.willShowCell.frame = CGRectMake(0, self.fadeTranslationY, w, h);} else {self.willShowCell.frame = CGRectMake(0, 0, w, h);}} completion:^(BOOL finished) {if (self.isRefresing) {return;}self->_currentIndex++;int count = (int)[self.dataSource numberOfRowsForRollingNoticeView:self];if (self->_currentIndex > count - 1) {self->_currentIndex = 0;}if (self.currentCell && self.willShowCell) {[self.reuseCells addObject:self.currentCell];}self.isAnimating = NO;int willShowIndex = self->_currentIndex + 1;if (willShowIndex > count - 1) {willShowIndex = 0;}self->_currentCell = self->_willShowCell;self->_willShowCell = [self.dataSource rollingNoticeView:self cellAtIndex:willShowIndex];self->_willShowCell.frame = CGRectMake(0, self.fadeTranslationY, w, h);self->_willShowCell.alpha = 0;[self addSubview:self.willShowCell];}];
}

附上链接
轮播组件

使用方法

pod 'XBRollingView'
///自定义cell,继承于 XBNoticeViewCell
@interface LXBCustomRollingCell : XBNoticeViewCell@endtypedef NS_ENUM(NSUInteger, RollingStyle) {RollingStyleDefault = 0, ///默认样式,滚动轮播RollingStyleFade = 1, /// 渐隐轮播
};
- (void)viewDidLoad
{[super viewDidLoad];XBRollingNoticeView *rollView = [[XBRollingNoticeView alloc] initWithFrame:CGRectMake(10, 100, 200, 70)];[rollView registerClass:[LXBCustomRollingCell class] forCellReuseIdentifier:NSStringFromClass([LXBCustomRollingCell class])];///动画时间rollView.animationDuration = 0.3;///停留时间rollView.stayInterval = 3;rollView.style = RollingStyleFade;rollView.delegate = self;rollView.dataSource = self;[rollView reloadDataAndStartRoll];[self.view addSubview:rollView];
}#pragma mark - LXBRollingNoticeViewDelegate, LXBRollingNoticeViewDelegate
- (XBNoticeViewCell *)rollingNoticeView:(XBRollingNoticeView *)rollingView cellAtIndex:(NSUInteger)index
{LXBCustomRollingCell *cell = [rollingView dequeueReusableCellWithIdentifier:NSStringFromClass([LXBCustomRollingCell class])];[cell updateWithRow:index];return cell;
}- (NSInteger)numberOfRowsForRollingNoticeView:(XBRollingNoticeView *)rollingView
{return 4;
}
http://www.lbrq.cn/news/1275211.html

相关文章:

  • flash网站导航条怎么做/怎么制作公司网站
  • 优化网站公司价格是多少钱/seo网站诊断顾问
  • 杭州网站建设过程/搜狗网站收录提交入口
  • 遵义水网站建设/百度推广竞价排名
  • jsp技术做网站有什么特点/线上网络平台推广
  • 枣庄市网站建设/指数分布的期望和方差
  • 手机网站flash/seo站内优化技巧
  • php网站开发账号密码/如何给公司做网络推广
  • 07年做网站/输入关键词自动生成标题
  • 幼儿园网站建设情况/2345网址导航电脑版
  • js图片展示网站/南昌关键词优化软件
  • 网页制作与网站建设实战大全/百度爱采购优化软件
  • 自己怎么做免费网站空间/市场营销活动策划方案
  • 网站的分辨率是多少/推广员是做什么的
  • 做微博网站/seo关键词词库
  • 信访举报网站建设情况总结/seo优化是指
  • wordpress电视主题/百度站长工具seo综合查询
  • 锦州网站建设最独特/windows11优化大师
  • 温州快建网站/河源新闻最新消息
  • 滑县住房城乡建设厅门户网站/湖南seo推广系统
  • 做网站去哪里/线上推广宣传方式有哪些
  • 网站 如何做用户统计/百度网址入口
  • 人妖和美女做视频网站/深圳高端seo外包公司
  • 网站开发流程可规划为那三个阶段/seo站长工具查询系统
  • 装饰公司网站建设/百度搜索量查询
  • 广告公司的网站建设价格/app制作公司
  • 网站关键词布局图/百度一下你就知道网页
  • 小区服务网站开发论文/百度地图疫情实时动态
  • 商丘市建立网站公司/seo搜索引擎优化平台
  • asp网站出现乱码/百度知道问答
  • 超聚变:智能体时代,AI原生重构城企数智化基因
  • Spring Security之初体验
  • 了解SQL
  • 三十二、【Linux网站服务器】搭建httpd服务器演示虚拟主机配置、网页重定向功能
  • 原生微信小程序实现语音转文字搜索---同声传译
  • 《零基础入门AI:传统机器学习入门(从理论到Scikit-Learn实践)》