caanimation

why changing of tab, stopping the animation in ios app?

萝らか妹 提交于 2019-12-06 01:50:15
问题 i have multiple tabs in my app. i one view controller there is animation running, when i switch to another view controller, and again comes to view controller with animation, then animation stops, can anybody guide me to work my Xcode even switching of tab in Iphone app? - (IBAction)btn:(id)sender { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSString *soundStatus = [defaults objectForKey:@"Sound_Swich"]; //NSLog(@"soundstatus is %@ ", soundStatus); if([soundStatus

Fade background-color from one color to another in a UIView

跟風遠走 提交于 2019-12-04 13:08:12
问题 How can I fade from one background-color to another color in a UIView? In javascript (jQuery) it can be done by doing the following: $('body').animate({ backgroundColor: "#ff00ff"}); Would it be easier if I converted the colors to HSV? EDIT: Tried to do it with CABasicAnimation but it flashes white for unknown reasons. :/ CABasicAnimation* fade = [CABasicAnimation animationWithKeyPath:@"backgroundColor"]; fade.fillMode = kCAFillModeForwards; fade.removedOnCompletion = NO; // fade.fromValue =

CABasicAnimation - animationDidStop not called

 ̄綄美尐妖づ 提交于 2019-12-04 12:44:36
I am making a CABasicAnimation and the problem is that the animationDidStop delegate method does not get called. I am not sure why but hopefully someone knows. Here is my animation: CABasicAnimation *theAnimation; theAnimation = [CABasicAnimation animationWithKeyPath: @"transform.translation.x"]; theAnimation.duration = 54; //theAnimation.repeatCount = 6; theAnimation.autoreverses = YES; theAnimation.removedOnCompletion = YES; theAnimation.fromValue = [NSNumber numberWithFloat: (self.myImageView.frame.size.height / 5) + (self.view.frame.size.height - self.myImageView.center.x)]; theAnimation

Animation Snaps back when the UIImage is changed

China☆狼群 提交于 2019-12-04 05:32:46
问题 I have an UIImageView that runs across the screen when a button is pressed and held. When the button is pressed is changes the UIImage of the UIImageView and when the button is let go I change it to its original UIImage. When ever the image changes back it snaps back to the location that the image started. This Timer is called when the button is pressed: //This is the image that changes when the button is pressed. imView.image = image2; runTimer = [NSTimer scheduledTimerWithTimeInterval:0.04

why changing of tab, stopping the animation in ios app?

感情迁移 提交于 2019-12-04 05:23:15
i have multiple tabs in my app. i one view controller there is animation running, when i switch to another view controller, and again comes to view controller with animation, then animation stops, can anybody guide me to work my Xcode even switching of tab in Iphone app? - (IBAction)btn:(id)sender { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSString *soundStatus = [defaults objectForKey:@"Sound_Swich"]; //NSLog(@"soundstatus is %@ ", soundStatus); if([soundStatus isEqual:@"YES"]) { [self soundEffect]; } if ([btnpress isEqualToString:@"start"]) { btnpress= @"pause"; int

How to flip a UIView around the x-axis while simultaneously switching subviews

巧了我就是萌 提交于 2019-12-03 19:31:23
问题 This question has been asked before but in a slightly different way and I was unable to get any of the answers to work the way I wanted, so I am hoping somebody with great Core Animation skills can help me out. I have a set of cards on a table. As the user swipes up or down the set of cards move up and down the table. There are 4 cards visible on the screen at any given time, but only the second card is showing its face. As the user swipes the second card flips back onto its face and the next

Mixing Images and Video using AVFoundation

房东的猫 提交于 2019-12-03 14:11:33
I'm trying to splice in images into a pre-existing video to create a new video file using AVFoundation on Mac. So far I've read the Apple documentation example, ASSETWriterInput for making Video from UIImages on Iphone Issues Mix video with static image in CALayer using AVVideoCompositionCoreAnimationTool AVFoundation Tutorial: Adding Overlays and Animations to Videos and a few other SO links Now these have proved to be pretty useful at times, but my problem is that I'm not creating a static watermark or an overlay exactly I want to put in images between parts of the video. So far I've managed

Animate a point of a Bezier curve [duplicate]

怎甘沉沦 提交于 2019-12-03 13:46:17
问题 This question already has an answer here : How to Animate a UIBezierPath (1 answer) Closed 6 years ago . Is is possible to animate a point of a bezier curve? I am trying make a smooth transition from a line to an arrow. Here's what the line looks like in code //// Color Declarations UIColor* white = [UIColor colorWithRed: 1 green: 1 blue: 1 alpha: 0.374]; //// Group { //// Bezier Drawing UIBezierPath* bezierPath = [UIBezierPath bezierPath]; [bezierPath moveToPoint: CGPointMake(30.5, 43.5)];

animating the length of circular arrow mask in Core Animation

无人久伴 提交于 2019-12-03 08:51:23
问题 I've created a circular animation using CAShapeLayer and masking. Here is my code: - (void) maskAnimation{ animationCompletionBlock theBlock; imageView.hidden = FALSE;//Show the image view CAShapeLayer *maskLayer = [CAShapeLayer layer]; CGFloat maskHeight = imageView.layer.bounds.size.height; CGFloat maskWidth = imageView.layer.bounds.size.width; CGPoint centerPoint; centerPoint = CGPointMake( maskWidth/2, maskHeight/2); //Make the radius of our arc large enough to reach into the corners of

Fade background-color from one color to another in a UIView

人走茶凉 提交于 2019-12-03 08:01:07
How can I fade from one background-color to another color in a UIView? In javascript (jQuery) it can be done by doing the following: $('body').animate({ backgroundColor: "#ff00ff"}); Would it be easier if I converted the colors to HSV? EDIT: Tried to do it with CABasicAnimation but it flashes white for unknown reasons. :/ CABasicAnimation* fade = [CABasicAnimation animationWithKeyPath:@"backgroundColor"]; fade.fillMode = kCAFillModeForwards; fade.removedOnCompletion = NO; // fade.fromValue = (id)[self.view backgroundColor].CGColor; fade.toValue = (id)[UIColor greenColor].CGColor; [self.view