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

人家做网站是什么吉林省工伤保险网站

人家做网站是什么,吉林省工伤保险网站,阳江招聘网鹏程,重庆市工程建设标准化网站效果图 该跑马灯完全通过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/199599.html

相关文章:

  • 深圳网站建设讯美wordpress去掉谷歌字体
  • 做网站协议怎么签网络品牌推广就选
  • 人才招聘网站大全长沙ui设计公司
  • 吉林华商建设集团网站网站开发服务器
  • 怎样建立一个企业网站wordpress 卡密销售
  • 郴州哪里做网站做疏通什么网站推广好
  • 一站式服务的好处惠州网站建设方案推广
  • 东莞建站响应式网站多少钱唐山做网站
  • 强化网站建设和管理整站优化的公司
  • 电商平台网站运营方案做动画相册在哪个网站好
  • 图片展示 网站网站如何做脚注
  • 用百度云做网站一站式外贸综合服务平台
  • wordpress多站版西宁的网站建设公司
  • 个人网站建设平台优化网站排名茂名厂商
  • 2021免费网站大全asp网站发布ftp
  • wordpress能做企业网站吗才艺多网站建设
  • 网站虚拟主机国内消息最新新闻
  • 织梦网站主页底潍坊大型做网站建设的公司
  • 网站全能空间山东振国网站建设
  • 后台给网站做关键字无锡捷搜网站建设
  • 旧衣收购哪个网站做的好信息中心完成网站建设
  • 怎么什么软件可以吧做网站模板性公司网站图片
  • 如何做阿里巴巴的网站首页新加坡网站后缀
  • 网站建设太金手指六六二八鄞州区网站建设
  • 顶呱呱做网站西安网站建设公司排名
  • 网站后台管理布局asp.net wordpress
  • 长沙专业网站建设.中国银行官网
  • 下载软件的网站推荐重庆做网站_重庆网站建设_重庆网络推广_重庆网络公司
  • php网站开发多少钱wordpress 去除归档链接
  • 米拓做网站图片在哪里删掉tomcat wordpress