core-animation

CAShapeLayer animation (arc from 0 to final size)

家住魔仙堡 提交于 2019-12-03 06:39:28
I have a CAShapeLayer in which an arc is added using UIBezierPath . I saw a couple of posts (one actually) here on stackoverflow but none seemed to give me the answer. As said in the title I would like to animate an arc (yes it will be for a pie chart). How can one accomplish an animation from an "empty" arc to the fully extended one? Kinda like a curved progress bar. Is it really impossible to do it via CoreAnimation ? Here's how I "do" the arc. Oh and ignore the comments and calculation since I'm used to counter clockwise unit circle and apple goes clockwise. The arcs appear just fine, I

Chain UIView animations with time intervals

Deadly 提交于 2019-12-03 06:36:48
I need to animate 3 UIViews (fade in/out). 1 animation duration is 0.6s (fade in/out cycle is 0.6+0.6s). But I need to launch animations in 0.2 seconds. 1st animation should be launched in 0.0 seconds. 2nd animation should be launched in 0.2 seconds. 3rd animation should be launched in 0.4 seconds. And all of them should be looped "indefinitely" (until some trigger). What I have at the moment: - (void)playAnimation { isAnimated = YES; [self animateView:firstView afterDelay:0.0]; [self animateView:secondView afterDelay:0.2]; [self animateView:thirdView afterDelay:0.4]; } - (void)stopAnimation {

Remove UIVIew from SuperView with Animation

两盒软妹~` 提交于 2019-12-03 06:22:47
问题 I can animate the addition of a UIView to my app, it looks very pretty so thank you apple. However, how do I animate the removal of this view from the super view? I'm using: CATransition *animation = [CATransition animation]; [animation setDuration:1]; [animation setType:kCATransitionReveal]; [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]]; [[myview layer] addAnimation:animation forKey:kCATransitionReveal]; to animate the "in" transition ...

How do I animate/rotate a UIView 90 degress from its upper right corner?

Deadly 提交于 2019-12-03 06:22:39
问题 I've been searching for hours trying to find a way to animate/rotate a UIView 90 degrees from the upper right corner. The effect should almost work like a swinging door from the top of the screen. Hope someone can help! 回答1: So right after I pressed enter I suddenly put two and two together and figured the Metronome sample worked kind of like a swinging door and that led me to a few other possibilities. Here's my solution: - (void)viewDidLoad { [super viewDidLoad]; // Set the anchor point and

How can I chain Core Animations for different Layers one after the other?

谁都会走 提交于 2019-12-03 06:21:26
I have a scrollView with paging enabled and a number N of pages, which are UIViews as subviews of the scrollView. I'm trying to do the following: User scrolls to page number n. At that point, 7 CALayers which were previously added to page number n (that is, to page [[scrollView subviews] objectAtIndex:n-1].layer subLayers]) fade in, one after the other. But I can't figure out how to make the CALayers fadeIn sequentially.So far, I've tried the following 3 approaches from my controller's delegate method: (assume I have an array to the layers and that their opacity was set to 0 upon creation) -

How to render a CALayer with a different blending mode, like screen or multiply?

纵然是瞬间 提交于 2019-12-03 06:14:46
I have a UIImageView and want it to be displayed with a specific blend mode. I know the iPhone has different blend modes, and it's probably possible to do it with a lot of CG code… but maybe there's a nice way with the CALayer of UIImageView ? humasect see here: composite colors: CALayer and blend mode on iPhone Set the compositingFilter of a view's layer to a supported blend mode string. From the docs, a layer's compositingFilter is A CoreImage filter used to composite the layer and the content behind it. To obtain a list of Core Image filters, print out the filter names defined by a

Animating a gaussian blur using core animation?

女生的网名这么多〃 提交于 2019-12-03 06:13:54
问题 I'm trying to animate something where it's initially blurry then it comes into focus. I guess it works OK, but when the animation is done it's still a little blurry. Am I doing this wrong? CABasicAnimation* blurAnimation = [CABasicAnimation animation]; CIFilter *blurFilter = [CIFilter filterWithName:@"CIGaussianBlur"]; [blurFilter setDefaults]; [blurFilter setValue:[NSNumber numberWithFloat:0.0] forKey:@"inputRadius"]; [blurFilter setName:@"blur"]; [[self layer] setFilters:[NSArray

Marrying Core Animation with OpenGL ES

你。 提交于 2019-12-03 06:07:55
问题 Edit: I suppose instead of the long explanation below I might also ask: Sending -setNeedsDisplay to an instance of CAEAGLLayer does not cause the layer to redraw (i.e., -drawInContext: is not called). Instead, I get this console message: <GLLayer: 0x4d500b0>: calling -display has no effect. Is there a way around this issue? Can I invoke -drawInContext: when -setNeedsDisplay is called? Long explanation below: I have an OpenGL scene that I would like to animate using Core Animation animations.

Animate scrolling of UIScrollView with CoreAnimation

故事扮演 提交于 2019-12-03 06:06:07
Sorry for a big question, real question are bold in bottom, now some explanation. I'm use CoreAnimation in my project for animate some objects moving like this. CABasicAnimation *moveAnimation; moveAnimation=[CABasicAnimation animationWithKeyPath:@"position"]; moveAnimation.duration = 2.0; moveAnimation.repeatCount=1; moveAnimation.autoreverses=NO; moveAnimation.delegate = self; moveAnimation.fromValue = [NSValue valueWithCGPoint:[crawler.layer position]]; moveAnimation.fillMode = kCAFillModeForwards; moveAnimation.removedOnCompletion = NO; CGPoint p; moveAnimation.toValue = [NSValue

How do I achieve continuous rotation of an NSImage inside NSImageView?

百般思念 提交于 2019-12-03 06:01:33
问题 FUTURE VIEWERS: I have managed to finish this rotation animation and code with description can be found on tho question. NSImage rotation in NSView is not working Before you proceed please up vote Duncan C 's answer. As I manage to achieve this rotation from his answer. I have an image like this, I want to keep rotating this sync icon, On a different thread. Now I tried using Quartz composer and add the animation to QCView but it is has very crazy effect and very slow too. Question : How do I