caanimation

Black Video outputted via AVMutableVideoComposition and CAAnimation

∥☆過路亽.° 提交于 2019-12-13 03:45:45
问题 I am building iOS application that is able to record video and add animation overlay over recorded video with AVFoundation and CAAnimation . All sub features are working fine but end of video's background is black while animation is playing. It's not rendering background video that I selected. I've used AVAssetWriter to record video and it's well played on camera roll. But if I use this recorded video to add overlay, end of video's background is black. Interesting thing is if I record video

CALayer Positioning After Object Has Moved

六眼飞鱼酱① 提交于 2019-12-12 11:35:18
问题 I animate my UIImageView with CAAnimation using layer property like so: [imageView.layer addAnimation:pathAnimation forKey:[NSString stringWithFormat:@"pathAnimation%@",objId]]; But at the end of my animation (after object has moved from original point) when I read the frame's X Y coordinates or center coordinates they always appear to be original ones, not those where the object has moved to. How to read layer's coordinates so I determine the correct location of my moving object? Here is my

CAAnimation: Don't reset after animation

*爱你&永不变心* 提交于 2019-12-12 03:04:06
问题 I have this code to move a view. CABasicAnimation *theAnimation; theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.x"]; theAnimation.duration=1; theAnimation.repeatCount=1; theAnimation.autoreverses=NO; theAnimation.fromValue=[NSNumber numberWithFloat:0]; theAnimation.toValue=[NSNumber numberWithFloat:-60]; [view.layer addAnimation:theAnimation forKey:@"animateLayer"]; The problem is: The actual coordinates of the view get reseted after the animation has finished. Is

CABasicAnimation resets when edge swiping with UINavigationController

徘徊边缘 提交于 2019-12-11 10:11:25
问题 I have the following CABasicAnimation run in my viewDidLoad for a view controller inside a UINavigationController : CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; animation.duration = 1; animation.additive = NO; animation.removedOnCompletion = NO; animation.fillMode = kCAFillModeForwards; animation.fromValue = [NSNumber numberWithFloat:0]; animation.toValue = [NSNumber numberWithFloat:-1*(((-windBearing+180) * M_PI) / 180)]; [compass.layer

CAAnimation - change properties in the last frame of the animation?

故事扮演 提交于 2019-12-11 04:10:17
问题 I'm animating a UIView (or rather its CALayer) and at the end of the animation it is no longer visible (I do a 3D transform so that it rotates about y by 90°, imagine a door opening towards you), though it's technically 'visible' in that its frame is still on-screen. At the end of this animation, I remove that view from its superview in the animationDidStop:finished: method. Problem is, there's a brief flicker where you see this view in its original untransformed state before it gets removed.

How to know when UIView animations have all completed

你。 提交于 2019-12-10 21:23:39
问题 A custom view I created is being animated by its container - in my view I update portions of the subviews with other animations (for instance a UICOllectionView) I see that this is throwing errors *** Assertion failure in -[UICollectionView _endItemAnimations Digging around I see that my view has animations attached to it: <GeneratorView: 0x15b45950; frame = (0 0; 320 199); animations = { position=<CABasicAnimation: 0x145540a0>; }; layer = <CALayer: 0x15b49410>> So now before performing

Changing UIView background color using an animation

 ̄綄美尐妖づ 提交于 2019-12-10 15:57:10
问题 I want to change my UIView background color with a transition animation. For example, if the view is red and I change it to blue. The blue color will slide up from the bottom of the screen to the top and fill the whole screen. I was thinking of doing this by making a UIView of identical size with the desired color and then animating it from off screen up to the top. This doesn't seem like a very elegant way to do it though. Is there any better way of doing this? Any points would be really

Convert/Wrap Swift struct as NSValue for CAAnimation purposes?

人盡茶涼 提交于 2019-12-10 15:12:47
问题 I have a custom CALayer subclass that draws a circular arc. It looks something like: class ArcLayer: CALayer { var strokeColor:UIColor = UIColor.blackColor() { didSet { self.setNeedsDisplay() }} var strokeWidth:CGFloat = 1.0 { didSet { self.setNeedsDisplay() }} var strokeCap:CGLineCap = .Butt { didSet { self.setNeedsDisplay() }} var startRadians:CGFloat = 0.0 { didSet { self.setNeedsDisplay() }} var sweepRadians:CGFloat = Tau { didSet { self.setNeedsDisplay() }} // other init's omitted for

How to create a CAAnimation effect like moon rotates around the earth and rotates by itself at the same time in IOS?

不打扰是莪最后的温柔 提交于 2019-12-08 11:37:29
问题 I know it is simple to create the effect making the moon circling around the earth in IOS. Suppose the moon is a CALayer object, just change the anchorPoint of this object to the earth then it will animate circling around the earth. But how to create the moon that rotate by itself at the same time? since the moon can only have one anchorPoint, seems I can not make this CALayer object rotate by itself anymore. What do you guys think? thanks. 回答1: Use two layers. One is an invisible "arm"

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