cakeyframeanimation

Cannot get current position of CALayer during animation

末鹿安然 提交于 2019-11-28 17:06:49
I am trying to achieve an animation that when you hold down a button it animates a block down, and when you release, it animates it back up to the original position, but I cannot obtain the current position of the animating block no matter what. Here is my code: -(IBAction)moveDown:(id)sender{ CGRect position = [[container.layer presentationLayer] frame]; [movePath moveToPoint:CGPointMake(container.frame.origin.x, position.y)]; [movePath addLineToPoint:CGPointMake(container.frame.origin.x, 310)]; CAKeyframeAnimation *moveAnim = [CAKeyframeAnimation animationWithKeyPath:@"position"]; moveAnim

Why CAAnimation Rotation is returning to previous state

梦想与她 提交于 2019-11-28 11:38:55
问题 I am using CAKeyFrameAnimation to do rotation of an arrow image. Problem is that the imageview is returning back to the previos state after animation. Code: CAKeyframeAnimation *rotation = [CAKeyframeAnimation animation]; rotation.duration = 0.55; rotation.cumulative = TRUE; rotation.removedOnCompletion = NO; if (isFlipRight) { rotation.values = [NSArray arrayWithObjects: [NSValue valueWithCATransform3D:CATransform3DMakeRotation(0.0, 0.0f, 1.0f, 0.0f)], [NSValue valueWithCATransform3D

Update view's frame while it's being animated

微笑、不失礼 提交于 2019-11-28 09:08:41
问题 I'm doing an animation like this: CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; animation.duration = 100.0; animation.path = self.animationPath.CGPath; [view.layer addAnimation:animation forKey:@"animation"]; Works fine, however, this now fails when trying to detect touches on the object that is moving around the screen: - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event { for (UIView* subview in self.subviews ) { if ( [subview hitTest:

CoreAnimation - Opacity Fade In and Out Animation Not Working

久未见 提交于 2019-11-28 05:01:58
I'm attempting to create a fairly simple CoreAnimation for use in an AVComposition . My goal is to create a CALayer which, through various sublayers, fades a title in and out, then fades in an out images. A slideshow, basically. This is being exported to a .mov using AVAssetWriter . With help from the WWDC 2011 AVEditDemo, I've been able to get a title and images appearing. The problem is that they are all on screen at the same time! I have created each layer with an opacity of 0.0. I have then added an CABasicAnimation to fade them from 0.0 to 1.0, using the following code: CABasicAnimation

CoreAnimation - Opacity Fade In and Out Animation Not Working

隐身守侯 提交于 2019-11-27 00:44:58
问题 I'm attempting to create a fairly simple CoreAnimation for use in an AVComposition . My goal is to create a CALayer which, through various sublayers, fades a title in and out, then fades in an out images. A slideshow, basically. This is being exported to a .mov using AVAssetWriter . With help from the WWDC 2011 AVEditDemo, I've been able to get a title and images appearing. The problem is that they are all on screen at the same time! I have created each layer with an opacity of 0.0. I have

NSTimer not fired when uiscrollview event occurs

為{幸葍}努か 提交于 2019-11-26 22:16:44
问题 I have a UIImageView placed in UIScrollView, Basicly this UIImageView holds very big map, and created animation on a predefined path with "arrows" pointed navigation direction. But, whenever uiscrollevents occurs, I think MainLoop freezes and NSTimer being not fired, and animation stopped. Are there any existing property, which solves this problem, on UIScrollView, CAKeyFrameAnimation or NSTimer? //viewDidLoad self.myTimer = [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector: