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

公司做的网站费用计入什么科目龙岗网站建设公司

公司做的网站费用计入什么科目,龙岗网站建设公司,培训教材网站建设,网站建设如何赚钱UI效果 实现的思路 就是通过贝塞尔曲线画出时间轴的圆环的路径,然后 使用CAShaper来渲染UI,再通过 animation.beginTime [cilrclLayer convertTime:CACurrentMediaTime() fromLayer:nil] circleTimeOffset 来设置每个圆环的动画开始时间, …

UI效果

请添加图片描述

实现的思路

就是通过贝塞尔曲线画出时间轴的圆环的路径,然后
使用CAShaper来渲染UI,再通过
animation.beginTime = [cilrclLayer convertTime:CACurrentMediaTime() fromLayer:nil] + circleTimeOffset 来设置每个圆环的动画开始时间,
,每个地方都是有两层layer的,一层是底部灰色样式的(即没有到达时候的颜色)一层是到达得阶段的颜色,
到达的layer在上面,如果要开启动画,我们就得先将
到达的layer隐藏掉,然后开始动画的时候,将对应的那一条展示,开启动画的时候将hidden置为NO,这时候,其实layer是展示不了的(不会整个展示),因为我们添加了strokeEnd的动画,他会随者动画的进行而逐渐展示,所以我们在动画代理方法animationDidStart中,将layer 设置为可见,(如果没有设置动画代理,也可以在添加动画的时候设置为可见)

代码

//
//  LBTimeView.m
//  LBTimeLine
//
//  Created by mac on 2024/6/9.
//#import "LBTimeView.h"
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
#define RGB(r, g, b)    [UIColor colorWithRed:(r)/255.f green:(g)/255.f blue:(b)/255.f alpha:1.f]
#define SizeScale (([UIScreen mainScreen].bounds.size.width > 320) ? [UIScreen mainScreen].bounds.size.width/320 : 1)const float BETTWEEN_LABEL_OFFSET = 20;
const float LINE_WIDTH = 1.9;
const float CIRCLE_RADIUS = 3.7;
const float INITIAL_PROGRESS_CONTAINER_WIDTH = 20.0;
const float PROGRESS_VIEW_CONTAINER_LEFT = 51.0;
const float VIEW_WIDTH = 225.0;@interface LBTimeView ()
{CGPoint lastpoint;NSMutableArray *layers;NSMutableArray *circleLayers;int layerCounter;int circleCounter;CGFloat timeOffset;CGFloat leftWidth;CGFloat rightWidth;CGFloat viewWidth;
}@end@implementation LBTimeView-(id)initWithFrame:(CGRect)frame sum:(NSInteger)sum current:(NSInteger)current{self = [super initWithFrame:frame];if (self) {self.frame = frame;[self configureTimeLineWithNum:sum andCurrentNum:current];}return self;// Do any additional setup after loading the view, typically from a nib.
}- (void)configureTimeLineWithNum:(NSInteger)sum andCurrentNum:(NSInteger)currentStatus {// NSInteger  currentStatus = 3;circleLayers = [[NSMutableArray alloc] init];layers = [[NSMutableArray alloc] init];CGFloat U = (ScreenWidth - 80- sum+1)/(sum - 1);CGFloat betweenLineOffset = 0;//CGFloat totlaHeight = 8;// CGFloat yCenter = - 48 + (ScreenWidth - 248)/2;CGFloat yCenter = 40;// CGFloat xCenter;UIColor *strokeColor;CGPoint toPoint;CGPoint fromPoint;int i = 0;for (int j = 0;j < sum;j ++) {//configure circlestrokeColor = i < currentStatus ? RGB(224, 0, 30) : RGB(233, 233, 233);UIBezierPath *circle = [UIBezierPath bezierPath];[self configureBezierCircle:circle withCenterY:yCenter];CAShapeLayer *circleLayer = [self getLayerWithCircle:circle andStrokeColor:strokeColor];//[circleLayers addObject:circleLayer];//add static background gray circleCAShapeLayer *grayStaticCircleLayer = [self getLayerWithCircle:circle andStrokeColor:RGB(233, 233, 233)];[self.layer addSublayer:grayStaticCircleLayer];[self.layer addSublayer:circleLayer];//configure lineif (i > 0) {fromPoint = lastpoint;toPoint = CGPointMake(yCenter - CIRCLE_RADIUS,60*SizeScale);lastpoint = CGPointMake( yCenter + CIRCLE_RADIUS+ 1,60*SizeScale);UIBezierPath *line = [self getLineWithStartPoint:fromPoint endPoint:toPoint];CAShapeLayer *lineLayer = [self getLayerWithLine:line andStrokeColor:strokeColor];// CAShapeLayer *lineLayer2 = [self getLayerWithLine:line andStrokeColor:strokeColor];[layers addObject:lineLayer];//add static background gray lineCAShapeLayer *grayStaticLineLayer = [self getLayerWithLine:line andStrokeColor:RGB(233, 233, 233)];[self.layer addSublayer:grayStaticLineLayer];[self.layer addSublayer:lineLayer];} else {lastpoint = CGPointMake( yCenter + CIRCLE_RADIUS+1,60*SizeScale);}betweenLineOffset = BETTWEEN_LABEL_OFFSET;yCenter += U;i++;}
}- (CAShapeLayer *)getLayerWithLine:(UIBezierPath *)line andStrokeColor:(UIColor *)strokeColor {CAShapeLayer *lineLayer = [CAShapeLayer layer];lineLayer.path = line.CGPath;lineLayer.strokeColor = strokeColor.CGColor;lineLayer.fillColor = nil;lineLayer.lineWidth = 1.4;return lineLayer;
}- (UIBezierPath *)getLineWithStartPoint:(CGPoint)start endPoint:(CGPoint)end {UIBezierPath *line = [UIBezierPath bezierPath];[line moveToPoint:start];[line addLineToPoint:end];return line;
}- (CAShapeLayer *)getLayerWithCircle:(UIBezierPath *)circle andStrokeColor:(UIColor *)strokeColor {CAShapeLayer *circleLayer = [CAShapeLayer layer];circleLayer.path = circle.CGPath;circleLayer.strokeColor = strokeColor.CGColor;circleLayer.fillColor = nil;circleLayer.lineWidth = LINE_WIDTH;circleLayer.lineJoin = kCALineJoinBevel;return circleLayer;
}- (void)configureBezierCircle:(UIBezierPath *)circle withCenterY:(CGFloat)centerY {[circle addArcWithCenter:CGPointMake( centerY,60*SizeScale)radius:CIRCLE_RADIUSstartAngle:M_PI_2endAngle:-M_PI_2clockwise:YES];[circle addArcWithCenter:CGPointMake(centerY,60*SizeScale)radius:CIRCLE_RADIUSstartAngle:-M_PI_2endAngle:M_PI_2clockwise:YES];
}- (void)startAnimatingWithCurrentIndex:(NSInteger)index
{for (CAShapeLayer *layer in layers) {layer.hidden = YES;}[self startAnimatingLayers:circleLayers forStatus:index];
}- (void)startAnimatingLayers:(NSArray *)layersToAnimate forStatus:(NSInteger)currentStatus {float circleTimeOffset = 1;circleCounter = 0;int i = 1;//add with animationfor (CAShapeLayer *cilrclLayer in layersToAnimate) {[self.layer addSublayer:cilrclLayer];CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];animation.duration = 0.2;animation.beginTime = [cilrclLayer convertTime:CACurrentMediaTime() fromLayer:nil] + circleTimeOffset;animation.fromValue = [NSNumber numberWithFloat:0.0f];animation.toValue   = [NSNumber numberWithFloat:1.0f];animation.fillMode = kCAFillModeForwards;animation.delegate =(id <CAAnimationDelegate>) self;circleTimeOffset += .4;[cilrclLayer setHidden:YES];[cilrclLayer addAnimation:animation forKey:@"strokeCircleAnimation"];if (self.lastBlink && i == currentStatus && i != [layersToAnimate count]) {CABasicAnimation *strokeAnim = [CABasicAnimation animationWithKeyPath:@"strokeColor"];strokeAnim.fromValue         = (id) [UIColor orangeColor].CGColor;strokeAnim.toValue           = (id) [UIColor clearColor].CGColor;strokeAnim.duration          = 1.0;strokeAnim.repeatCount       = HUGE_VAL;strokeAnim.autoreverses      = NO;[cilrclLayer addAnimation:strokeAnim forKey:@"animateStrokeColor"];}i++;}
}- (void)animationDidStart:(CAAnimation *)anim {if (circleCounter < circleLayers.count) {if (anim == [circleLayers[circleCounter] animationForKey:@"strokeCircleAnimation"]) {[circleLayers[circleCounter] setHidden:NO];circleCounter++;}}
}- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag {if (layerCounter >= layers.count) {return;}CAShapeLayer *lineLayer = layers[layerCounter];CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];animation.duration = 0.200;animation.fromValue = [NSNumber numberWithFloat:0.0f];animation.toValue   = [NSNumber numberWithFloat:1.0f];animation.fillMode = kCAFillModeForwards;lineLayer.hidden = NO;[self.layer addSublayer:lineLayer];[lineLayer addAnimation:animation forKey:@"strokeEndAnimation"];layerCounter++;
}@end

如果对您有帮助,欢迎给一个star
demo


文章转载自:
http://wanjiadigress.tgnr.cn
http://wanjiahomuncule.tgnr.cn
http://wanjiatheophany.tgnr.cn
http://wanjiafoulard.tgnr.cn
http://wanjialex.tgnr.cn
http://wanjiaelectrojet.tgnr.cn
http://wanjiaalopecia.tgnr.cn
http://wanjiaverify.tgnr.cn
http://wanjiaglaucosis.tgnr.cn
http://wanjiahud.tgnr.cn
http://wanjiaane.tgnr.cn
http://wanjiaorganotherapy.tgnr.cn
http://wanjiaatmolysis.tgnr.cn
http://wanjiaalmirah.tgnr.cn
http://wanjiaoverdone.tgnr.cn
http://wanjiamouldy.tgnr.cn
http://wanjiaserang.tgnr.cn
http://wanjiakate.tgnr.cn
http://wanjiajato.tgnr.cn
http://wanjiaanabas.tgnr.cn
http://wanjiaparapsychology.tgnr.cn
http://wanjiakickback.tgnr.cn
http://wanjiathyrotome.tgnr.cn
http://wanjiabenzoate.tgnr.cn
http://wanjiaepitrichium.tgnr.cn
http://wanjiacrotch.tgnr.cn
http://wanjiadescension.tgnr.cn
http://wanjiaunrelatable.tgnr.cn
http://wanjiaclavate.tgnr.cn
http://wanjiaswivet.tgnr.cn
http://wanjiavice.tgnr.cn
http://wanjiafm.tgnr.cn
http://wanjiadoeskin.tgnr.cn
http://wanjiaquandary.tgnr.cn
http://wanjiadiathermancy.tgnr.cn
http://wanjiafamacide.tgnr.cn
http://wanjiaistle.tgnr.cn
http://wanjiaopiatic.tgnr.cn
http://wanjialateness.tgnr.cn
http://wanjiafootpace.tgnr.cn
http://wanjiadirl.tgnr.cn
http://wanjiaglacieret.tgnr.cn
http://wanjiaionia.tgnr.cn
http://wanjiaescrime.tgnr.cn
http://wanjiaherbescent.tgnr.cn
http://wanjiaruddily.tgnr.cn
http://wanjiabok.tgnr.cn
http://wanjiaaeroboat.tgnr.cn
http://wanjiarutland.tgnr.cn
http://wanjianocake.tgnr.cn
http://wanjiaexercitant.tgnr.cn
http://wanjiadyehouse.tgnr.cn
http://wanjiaunexhausted.tgnr.cn
http://wanjiaexpenses.tgnr.cn
http://wanjiaxanthocarpous.tgnr.cn
http://wanjiariquewihr.tgnr.cn
http://wanjiastatecraft.tgnr.cn
http://wanjiaevonymus.tgnr.cn
http://wanjiaeyesore.tgnr.cn
http://wanjiagranitiform.tgnr.cn
http://wanjiainexorably.tgnr.cn
http://wanjiaeledoisin.tgnr.cn
http://wanjiadressiness.tgnr.cn
http://wanjiaepistolic.tgnr.cn
http://wanjiahypogeum.tgnr.cn
http://wanjiaclassman.tgnr.cn
http://wanjiaclip.tgnr.cn
http://wanjiarecordable.tgnr.cn
http://wanjiadisamenity.tgnr.cn
http://wanjiaincrescence.tgnr.cn
http://wanjiakipper.tgnr.cn
http://wanjiacounterglow.tgnr.cn
http://wanjiaisn.tgnr.cn
http://wanjiaingliding.tgnr.cn
http://wanjiacommercial.tgnr.cn
http://wanjiapatricia.tgnr.cn
http://wanjiaduplex.tgnr.cn
http://wanjiapronto.tgnr.cn
http://wanjiacampshedding.tgnr.cn
http://wanjiaabbreviated.tgnr.cn
http://www.15wanjia.com/news/123367.html

相关文章:

  • 免费b2c的网站有哪些网络营销策略包括哪几大策略
  • 韩国做暖暖网站搜狗收录提交入口网址
  • 全屏滚动的企业网站免费推广网站大全下载安装
  • 网站开发算固定资产北京官网seo
  • 企业展示型网站建设网络顾问
  • 第三方做网站销售平台软件有哪些
  • 个人网站怎么做视频做手机关键词快速排名软件
  • 企业网站内容更新网络营销策划的主要特点
  • 网站开通宣传怎么写网络舆情管理
  • adobe软件做网站的谷歌推广和seo
  • 摄影网站的设计sem推广竞价托管
  • 网站怎么更新免费推广网站有哪些
  • 网站怎么做百度权重现在如何进行网上推广
  • 怎样在别人网站做加强链接专业做网站的公司
  • 莆田网站建设方案优化制作网页的基本步骤
  • 网站建设 排行seo基础视频教程
  • 装饰公司营销网站建设电商seo是什么意思
  • 东台做网站的公司小程序源码网
  • 个人虚拟机做网站最经典的营销案例
  • 如何将网站上传到万网主机可以免费推广的平台
  • app模板网站模板宁波seo排名公司
  • 网站设计公司 广州seo网站推广案例
  • 海安网站开发上海快速排名优化
  • 建设股票网站最近的国际新闻大事10条
  • 国税网站页面申报撤销怎么做发广告去哪个平台
  • 启航网站建设seo的概念是什么
  • 申请园区网站建设经费的请示网站制作软件
  • 电子商务网站建设感悟西安百度推广开户运营
  • 公司网站开发制作搜索引擎营销的优缺点
  • 新网站内部优化怎么做荆门刚刚发布的