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

人家做网站是什么pc端和移动端的网站区别是什么

人家做网站是什么,pc端和移动端的网站区别是什么,WordPress插件做成主题代码,招聘网站做专题的目的效果图 该跑马灯完全通过CATextLayer 实现#xff0c;轻量级#xff0c;并且通过 系统的位移动画实现滚动效果#xff0c;避免了使用displaylink造成的性能瓶颈#xff0c;使用系统动画#xff0c;系统自动做了很多性能优化#xff0c;实现更好的性能#xff0c;并使用…效果图 该跑马灯完全通过CATextLayer 实现轻量级并且通过 系统的位移动画实现滚动效果避免了使用displaylink造成的性能瓶颈使用系统动画系统自动做了很多性能优化实现更好的性能并使用遮罩实现展示范围的限定 实现跑马灯效果 // // LBMarqueeLayer.m // TEXT // // Created by mac on 2024/4/28. // Copyright © 2024 刘博. All rights reserved. //#import LBMarqueeLayer.himplementation LBMarqueeLayerConfig- (instancetype)init {self [super init];if (self) {self.velocity 20;self.fontSize 14;self.textColor [UIColor darkGrayColor];self.pauseDuration 3;self.blankString ;}return self; }endinterface LBMarqueeLayer () CAAnimationDelegateproperty (nonatomic, strong) CATextLayer *textLayer;property (nonatomic, strong) CALayer *maskLayer;property (nonatomic, strong) LBMarqueeLayerConfig *config;property (nonatomic, strong) CABasicAnimation *animation;endimplementation LBMarqueeLayer- (instancetype)initwithFrame:(CGRect)frameconfig:(LBMarqueeLayerConfig *)config {if ([super init]) {self.frame frame;self.config config;[self handleText];[self addSublayer:self.textLayer];}return self; }- (void)handleText {CGFloat width [self.config.text sizeWithAttributes:{NSFontAttributeName:[UIFont systemFontOfSize:self.config.fontSize]}].width;if (width CGRectGetWidth(self.bounds)) {NSString *content [NSString stringWithFormat:%%%, self.config.text, self.config.blankString, self.config.text];NSAttributedString *attributedString [[NSAttributedString alloc] initWithString:content attributes:{NSFontAttributeName:[UIFont systemFontOfSize:self.config.fontSize]}];self.textLayer.string attributedString;CGFloat width [content sizeWithAttributes:{NSFontAttributeName: [UIFont systemFontOfSize:self.config.fontSize]}].width;self.textLayer.frame CGRectMake(0, 0, width, CGRectGetHeight(self.bounds));CGFloat toValue [[NSString stringWithFormat:%%, self.config.text, self.config.blankString] sizeWithAttributes:{NSFontAttributeName:[UIFont systemFontOfSize:self.config.fontSize]}].width;self.animation.fromValue (0);self.animation.toValue (-toValue);self.animation.duration toValue/self.config.velocity;[self.textLayer addAnimation:self.animation forKey:animation];self.masksToBounds YES;} else {self.textLayer.string self.config.text;}}#pragma mark - animationDelegate- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{if (flag) {dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.config.pauseDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{[self.textLayer addAnimation:self.animation forKey:animation];});}}#pragma mark - lazy load- (CATextLayer *)textLayer{if (!_textLayer) {_textLayer [[CATextLayer alloc] init];_textLayer.frame CGRectMake(0, 0, CGRectGetWidth(self.frame), CGRectGetHeight(self.frame));_textLayer.alignmentMode kCAAlignmentLeft;_textLayer.fontSize 14;_textLayer.foregroundColor self.config.textColor.CGColor;}return _textLayer;}- (CALayer *)maskLayer{if (!_maskLayer) {_maskLayer [[CALayer alloc] init];_maskLayer.frame self.bounds;}return _maskLayer;}- (CABasicAnimation *)animation{if (!_animation) {_animation [CABasicAnimation animationWithKeyPath:transform.translation.x];if (!self.config.hasPause) {_animation.repeatCount NSIntegerMax;}_animation.delegate self;}return _animation;}end 调用 - (LBMarqueeLayer *)textLayer {if (!_textLayer) {LBMarqueeLayerConfig *config [[LBMarqueeLayerConfig alloc] init];config.hasPause YES;config.pauseDuration 3;config.blankString ;config.text 这是一首非常好听的歌曲哈哈哈哈;_textLayer [[LBMarqueeLayer alloc] initwithFrame:CGRectMake(100, 100, 200, 50) config:config];_textLayer.backgroundColor [UIColor cyanColor].CGColor;}return _textLayer; }
http://www.dnsts.com.cn/news/65125.html

相关文章:

  • 动易网站 修改栏目名字免费公文写作网站
  • 哪些行业做网站推广的多织梦制作手机网站
  • 竞价推广网站建设做网站一定要用到dw
  • 一起做网店网站入驻收费建设企业门户网站
  • 辽宁平台网站建设平台海淀区网站搭建
  • wordpress 网站标题图做平面设计都在那个网站找免费素材
  • 网站谷歌排名番禺网站设计与制作
  • 在线制作图片网站义乌简游网络科技有限公司
  • 中学生做网站的软件一级站点和二级站点区别
  • 疗养院有必要做网站吗网站开发公司的
  • 客户为什么需要建站服务室内设计师培训装潢设计培训
  • 网站开发语言是什么企业年金太坑了
  • 东莞市做网站的公司哪家好自己做的网站验证码出不来怎么回事
  • 从网站验证码谈用户体验文山知名网站建设报价
  • 吉林公路建设有限公司网站智能家居产品设计案例
  • cms做企业网站建站系统舟山做网站公司
  • 福州市建网站公司wordpress网站缩
  • 电商网站开发工作计划百度快照 网站描述 更新
  • 网页自助建站新建的网站需要维护吗
  • 高职高专网站建设与维护网页设计师主要是做什么
  • 做网站彩票的代理好吗html教程推荐
  • 平谷区网站建设wordpress服务器不支持中文tag
  • 西部数码 网站管理辽宁省建设工程造价总站网站
  • 微信公众平台 网站开发phpcms手机网站怎么做
  • 无锡网站建设方式长沙有什么好玩的旅游景点
  • 临沂手机网站信息推广技术公司电话号码平面设计网络课程推荐
  • 网页关键词优化软件深圳seo优化seo优化
  • 济南网站建设系统介绍服务网站地图wordpress
  • 网站架构设计师待遇怎么样深圳小程序定制
  • 网页制作工具的选择与网站整体风格摄影建设网站