cakeyframeanimation

Synchronising image, text, and positioning with CoreAnimation

≡放荡痞女 提交于 2019-12-08 07:17:06
问题 I am a bit of a beginner with animations and have been experimenting with CoreAnimation for a couple of days. Feel free to warn me if this question does not make sense, but I'm trying to achieve the following. I have three objects: one should be an image, moving according to a given pattern one should be an UIImage that swaps two images one should be a text (CATextLayer?) whose content changes The three actions should happen in sync. As an example, think about a programme showing a sinusoid

Why does this CAKeyFrameAnimation stop with zero opacity?

蹲街弑〆低调 提交于 2019-12-08 02:26:55
问题 I have this code. At the end of the values array, you can see I provide 0.5 for the opacity. But for some reason, when the animation stops, it flashes once again and then leaves the view completely transparent. What's wrong there? CALayer *layer = self.layer; CAKeyframeAnimation *blinkAnim = [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; blinkAnim.duration = 1.0; //blinkAnim.repeatCount = 0; blinkAnim.autoreverses = NO; // keyframe times and values // we want to start fully opaque,

How to add a *progressive* animation delay based on n-th position?

 ̄綄美尐妖づ 提交于 2019-12-07 22:51:24
问题 I'd like to animate a list of items. The first should animate with 0ms delay, the second should do the same animation with 50ms delay, third with 100ms delay and so on. The list is dynamic so I won't know the length. Is this possible? Note: I don't need help with animations / keyframes specifically, but how to use nth-child or nth-of-type (or anything else?) to achieve a progressive animation delay based on relative position between siblings. I'm using React / SASS / Webpack if that helps. I

How to add a *progressive* animation delay based on n-th position?

我的梦境 提交于 2019-12-06 04:30:21
I'd like to animate a list of items. The first should animate with 0ms delay, the second should do the same animation with 50ms delay, third with 100ms delay and so on. The list is dynamic so I won't know the length. Is this possible? Note: I don't need help with animations / keyframes specifically, but how to use nth-child or nth-of-type (or anything else?) to achieve a progressive animation delay based on relative position between siblings. I'm using React / SASS / Webpack if that helps. I can use jQuery if necessary but I'd rather avoid it if possible. Here's an example on how to do

Drawing a path with CAKeyFrameAnimation on iPhone

谁说我不能喝 提交于 2019-12-04 20:21:40
问题 I want to draw a path gradually, i.e. I want the path to appear as if it is drawn by hand. I have managed to create the path I need. I have also managed to create a CAKeyFrameAnimation that uses this path. But so far I can only move an object along this path. I would like to both move an object (say a pencil) along the path, and have the path appear as if it is drawn. Any pointers? 回答1: Create a CAShapeLayer with your path and animate the layer's strokeEnd from 0.0 to 1.0 . (This is new in

iOS CAKeyFrameAnimation Scaling Flickers at animation end

≯℡__Kan透↙ 提交于 2019-12-04 09:38:15
问题 In another test of Key Frame animation I am combining moving a UIImageView (called theImage ) along a bezier path and scaling larger it as it moves, resulting in a 2x larger image at the end of the path. My initial code to do this has these elements in it to kick off the animation: UIImageView* theImage = .... float scaleFactor = 2.0; .... theImage.center = destination; theImage.transform = CGAffineTransformMakeScale(1.0,1.0); CABasicAnimation *resizeAnimation = [CABasicAnimation

Drawing a path with CAKeyFrameAnimation on iPhone

守給你的承諾、 提交于 2019-12-03 13:07:28
I want to draw a path gradually, i.e. I want the path to appear as if it is drawn by hand. I have managed to create the path I need. I have also managed to create a CAKeyFrameAnimation that uses this path. But so far I can only move an object along this path. I would like to both move an object (say a pencil) along the path, and have the path appear as if it is drawn. Any pointers? Create a CAShapeLayer with your path and animate the layer's strokeEnd from 0.0 to 1.0 . (This is new in iOS SDK 4.2, won't work with previous versions.) 来源: https://stackoverflow.com/questions/4390911/drawing-a

CAKeyframeAnimation Manual Progress

我是研究僧i 提交于 2019-12-03 10:12:32
问题 I have a UIView whose backing layer has a CAKeyframeAnimation with a simple straight line path set as its `path`. Can I have the animation "frozen", so to speak, and manually change its progress? For example: If the path is 100 points in length, setting the progress (offset?) to 0.45 should have the view move 45 points down the path. I remember seeing an article that did something similar (moving a view along a path based on the value from a slider) via CAMediaTiming interfaces, but I haven't

iOS CAKeyFrameAnimation Scaling Flickers at animation end

自古美人都是妖i 提交于 2019-12-03 03:29:12
In another test of Key Frame animation I am combining moving a UIImageView (called theImage ) along a bezier path and scaling larger it as it moves, resulting in a 2x larger image at the end of the path. My initial code to do this has these elements in it to kick off the animation: UIImageView* theImage = .... float scaleFactor = 2.0; .... theImage.center = destination; theImage.transform = CGAffineTransformMakeScale(1.0,1.0); CABasicAnimation *resizeAnimation = [CABasicAnimation animationWithKeyPath:@"bounds.size"]; [resizeAnimation setToValue:[NSValue valueWithCGSize:CGSizeMake(theImage

Can I animate the UIScrollView contentOffset property via its layer?

吃可爱长大的小学妹 提交于 2019-12-03 02:01:45
问题 I want to zoom and scroll a UIScrollView with a CGPathRef. Because of that I assume I have to animate the UIScrollView's layer property? But which property would I animate that would make it equivalent to doing a UIView animation and setting its contentOffset property and zoomScale ? These are not properties of a CALayer. Any ideas as to how I would approach this? Again, just want to move the scrollview to a certain contentOffset and zoomScale, but not necessarily linearly from point A to