애니메이션 CABasicAnimation
//
CABasicAnimation *basic=[CABasicAnimation animation];
//
basic.keyPath=@"bounds";
// basic.keyPath=@"transform.rotation";
//
basic.fromValue=[NSValue valueWithCGRect:CGRectMake(0, 0, 50, 50)];
//
basic.toValue=[NSValue valueWithCGRect:CGRectMake(0, 0, 300, 300)];
//
basic.duration=10;
//
basic.repeatCount=1;
//
basic.beginTime=CACurrentMediaTime()+2;
//
basic.removedOnCompletion=NO;
basic.fillMode=kCAFillModeBackwards;
//
[self.ballImageView .layer addAnimation:basic forKey:nil];
빙글빙글 돌다 //
CABasicAnimation *basic=[CABasicAnimation animation];
//
//basic.keyPath=@"bounds";
basic.keyPath=@"transform.rotation";
//
//basic.fromValue=[NSValue valueWithCGRect:CGRectMake(0, 0, 50, 50)];
//
//basic.toValue=[NSValue valueWithCGRect:CGRectMake(0, 0, 300, 300)];
basic.toValue=@(M_PI *2);
//
basic.duration=1;
//
basic.repeatCount=5;
//
// basic.beginTime=CACurrentMediaTime()+2;
//
basic.removedOnCompletion=NO;
basic.fillMode=kCAFillModeBackwards;
//
[self.ballImageView .layer addAnimation:basic forKey:nil];
프레임 애니메이션 //
CAKeyframeAnimation *keyframeAnimation=[CAKeyframeAnimation animation];
//
keyframeAnimation.keyPath=@"position";
//
NSValue *poiont1=[NSValue valueWithCGPoint:CGPointMake(100, 50)];
NSValue *poiont2=[NSValue valueWithCGPoint:CGPointMake(100, 650)];
NSValue *poiont3=[NSValue valueWithCGPoint:CGPointMake(100, 350)];
NSValue *poiont4=[NSValue valueWithCGPoint:CGPointMake(100, 650)];
NSValue *poiont5=[NSValue valueWithCGPoint:CGPointMake(100, 500)];
NSValue *poiont6=[NSValue valueWithCGPoint:CGPointMake(100, 650)];
NSValue *poiont7=[NSValue valueWithCGPoint:CGPointMake(100,600)];
NSValue *poiont8=[NSValue valueWithCGPoint:CGPointMake(100, 650)];
//
keyframeAnimation.values=@[poiont1,poiont2,poiont3,poiont4,poiont5,poiont6,poiont7,poiont8];
//
keyframeAnimation.keyTimes=@[@(0),@(0.3),@(0.4),@(0.5),@(0.6),@(0.7),@(0.8),@(0.9)];
//
keyframeAnimation.duration=3.0;
[self.ballImageView.layer addAnimation:keyframeAnimation forKey:nil];
베셀 곡선 //
CAKeyframeAnimation * keyframeA=[CAKeyframeAnimation animation];
//
keyframeA.keyPath=@"position";
//
//
//UIBezierPath *bezierPath=[UIBezierPath bezierPathWithOvalInRect:CGRectMake(50, 100, 150, 250)];
UIBezierPath *bezierPath=[UIBezierPath bezierPathWithArcCenter:self.view.center radius:150 startAngle:0 endAngle:M_PI *2 clockwise:YES];
//
keyframeA.path=bezierPath.CGPath;
//
[bezierPath closePath];
//
keyframeA.duration=1.0;
//
keyframeA.removedOnCompletion=NO;
keyframeA.fillMode=kCAFillModeForwards;
keyframeA.repeatCount=100;
[self.ballImageView.layer addAnimation:keyframeA forKey:nil];
그룹 애니메이션 //
CAAnimationGroup *group=[CAAnimationGroup animation];
//
CABasicAnimation *animation1=[CABasicAnimation animation];
//
animation1.keyPath=@"transform.rotation";
//
animation1.toValue=@(M_PI *2);
//
CABasicAnimation *animation2=[CABasicAnimation animation];
animation2.keyPath=@"bounds";
animation2.toValue=[NSValue valueWithCGRect:CGRectMake(0, 0, 0, 0)];
//
CABasicAnimation *animation3=[CABasicAnimation animation];
animation3.keyPath=@"transform.translation.x";
animation3.toValue=@(500);
//
group.animations=@[animation1,animation2,animation3];
//
group.duration=2.0;
//
group.delegate=self;
//
group.removedOnCompletion=NO;
group.fillMode=kCAFillModeForwards;
//
[self.ballImageView.layer addAnimation:group forKey:nil];
animationWithKeyPath 값:
transform.scale = 비례 변환transform.scale.x =
transform.scale.y =
transform.rotation.z =
opacity =
margin
zPosition
backgroundColor
cornerRadius
borderWidth
bounds
contents
contentsRect
cornerRadius
frame
hidden
mask
masksToBounds
opacity
position
shadowColor
shadowOffset
shadowOpacity
shadowRadius
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSON
JSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다.
그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다.
저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.
//
CABasicAnimation *basic=[CABasicAnimation animation];
//
//basic.keyPath=@"bounds";
basic.keyPath=@"transform.rotation";
//
//basic.fromValue=[NSValue valueWithCGRect:CGRectMake(0, 0, 50, 50)];
//
//basic.toValue=[NSValue valueWithCGRect:CGRectMake(0, 0, 300, 300)];
basic.toValue=@(M_PI *2);
//
basic.duration=1;
//
basic.repeatCount=5;
//
// basic.beginTime=CACurrentMediaTime()+2;
//
basic.removedOnCompletion=NO;
basic.fillMode=kCAFillModeBackwards;
//
[self.ballImageView .layer addAnimation:basic forKey:nil];
//
CAKeyframeAnimation *keyframeAnimation=[CAKeyframeAnimation animation];
//
keyframeAnimation.keyPath=@"position";
//
NSValue *poiont1=[NSValue valueWithCGPoint:CGPointMake(100, 50)];
NSValue *poiont2=[NSValue valueWithCGPoint:CGPointMake(100, 650)];
NSValue *poiont3=[NSValue valueWithCGPoint:CGPointMake(100, 350)];
NSValue *poiont4=[NSValue valueWithCGPoint:CGPointMake(100, 650)];
NSValue *poiont5=[NSValue valueWithCGPoint:CGPointMake(100, 500)];
NSValue *poiont6=[NSValue valueWithCGPoint:CGPointMake(100, 650)];
NSValue *poiont7=[NSValue valueWithCGPoint:CGPointMake(100,600)];
NSValue *poiont8=[NSValue valueWithCGPoint:CGPointMake(100, 650)];
//
keyframeAnimation.values=@[poiont1,poiont2,poiont3,poiont4,poiont5,poiont6,poiont7,poiont8];
//
keyframeAnimation.keyTimes=@[@(0),@(0.3),@(0.4),@(0.5),@(0.6),@(0.7),@(0.8),@(0.9)];
//
keyframeAnimation.duration=3.0;
[self.ballImageView.layer addAnimation:keyframeAnimation forKey:nil];
베셀 곡선 //
CAKeyframeAnimation * keyframeA=[CAKeyframeAnimation animation];
//
keyframeA.keyPath=@"position";
//
//
//UIBezierPath *bezierPath=[UIBezierPath bezierPathWithOvalInRect:CGRectMake(50, 100, 150, 250)];
UIBezierPath *bezierPath=[UIBezierPath bezierPathWithArcCenter:self.view.center radius:150 startAngle:0 endAngle:M_PI *2 clockwise:YES];
//
keyframeA.path=bezierPath.CGPath;
//
[bezierPath closePath];
//
keyframeA.duration=1.0;
//
keyframeA.removedOnCompletion=NO;
keyframeA.fillMode=kCAFillModeForwards;
keyframeA.repeatCount=100;
[self.ballImageView.layer addAnimation:keyframeA forKey:nil];
그룹 애니메이션 //
CAAnimationGroup *group=[CAAnimationGroup animation];
//
CABasicAnimation *animation1=[CABasicAnimation animation];
//
animation1.keyPath=@"transform.rotation";
//
animation1.toValue=@(M_PI *2);
//
CABasicAnimation *animation2=[CABasicAnimation animation];
animation2.keyPath=@"bounds";
animation2.toValue=[NSValue valueWithCGRect:CGRectMake(0, 0, 0, 0)];
//
CABasicAnimation *animation3=[CABasicAnimation animation];
animation3.keyPath=@"transform.translation.x";
animation3.toValue=@(500);
//
group.animations=@[animation1,animation2,animation3];
//
group.duration=2.0;
//
group.delegate=self;
//
group.removedOnCompletion=NO;
group.fillMode=kCAFillModeForwards;
//
[self.ballImageView.layer addAnimation:group forKey:nil];
animationWithKeyPath 값:
transform.scale = 비례 변환transform.scale.x =
transform.scale.y =
transform.rotation.z =
opacity =
margin
zPosition
backgroundColor
cornerRadius
borderWidth
bounds
contents
contentsRect
cornerRadius
frame
hidden
mask
masksToBounds
opacity
position
shadowColor
shadowOffset
shadowOpacity
shadowRadius
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSON
JSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다.
그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다.
저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.
//
CAKeyframeAnimation * keyframeA=[CAKeyframeAnimation animation];
//
keyframeA.keyPath=@"position";
//
//
//UIBezierPath *bezierPath=[UIBezierPath bezierPathWithOvalInRect:CGRectMake(50, 100, 150, 250)];
UIBezierPath *bezierPath=[UIBezierPath bezierPathWithArcCenter:self.view.center radius:150 startAngle:0 endAngle:M_PI *2 clockwise:YES];
//
keyframeA.path=bezierPath.CGPath;
//
[bezierPath closePath];
//
keyframeA.duration=1.0;
//
keyframeA.removedOnCompletion=NO;
keyframeA.fillMode=kCAFillModeForwards;
keyframeA.repeatCount=100;
[self.ballImageView.layer addAnimation:keyframeA forKey:nil];
//
CAAnimationGroup *group=[CAAnimationGroup animation];
//
CABasicAnimation *animation1=[CABasicAnimation animation];
//
animation1.keyPath=@"transform.rotation";
//
animation1.toValue=@(M_PI *2);
//
CABasicAnimation *animation2=[CABasicAnimation animation];
animation2.keyPath=@"bounds";
animation2.toValue=[NSValue valueWithCGRect:CGRectMake(0, 0, 0, 0)];
//
CABasicAnimation *animation3=[CABasicAnimation animation];
animation3.keyPath=@"transform.translation.x";
animation3.toValue=@(500);
//
group.animations=@[animation1,animation2,animation3];
//
group.duration=2.0;
//
group.delegate=self;
//
group.removedOnCompletion=NO;
group.fillMode=kCAFillModeForwards;
//
[self.ballImageView.layer addAnimation:group forKey:nil];
animationWithKeyPath 값:
transform.scale = 비례 변환transform.scale.x =
transform.scale.y =
transform.rotation.z =
opacity =
margin
zPosition
backgroundColor
cornerRadius
borderWidth
bounds
contents
contentsRect
cornerRadius
frame
hidden
mask
masksToBounds
opacity
position
shadowColor
shadowOffset
shadowOpacity
shadowRadius
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSON
JSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다.
그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다.
저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.
transform.scale.x =
transform.scale.y =
transform.rotation.z =
opacity =
margin
zPosition
backgroundColor
cornerRadius
borderWidth
bounds
contents
contentsRect
cornerRadius
frame
hidden
mask
masksToBounds
opacity
position
shadowColor
shadowOffset
shadowOpacity
shadowRadius이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.