cabasicanimation

Black effect when screen popping controller with custom animation?

*爱你&永不变心* 提交于 2019-12-08 05:40:26
问题 I am popping a view controller from navigation controller.When i am popping controller i want to give it animation like Pushing a view controller.For that purpose i am using below code CATransition* transition = [CATransition animation]; transition.duration = 0.3f; transition.type = kCATransitionPush; transition.subtype = kCATransitionFromRight; [self.navigationController.view.layer addAnimation:transition forKey:kCATransition]; [self.appDelegate setUpForLVC]; [self.navigationController

Black effect when screen popping controller with custom animation?

喜夏-厌秋 提交于 2019-12-07 15:02:30
I am popping a view controller from navigation controller.When i am popping controller i want to give it animation like Pushing a view controller.For that purpose i am using below code CATransition* transition = [CATransition animation]; transition.duration = 0.3f; transition.type = kCATransitionPush; transition.subtype = kCATransitionFromRight; [self.navigationController.view.layer addAnimation:transition forKey:kCATransition]; [self.appDelegate setUpForLVC]; [self.navigationController popViewControllerAnimated:NO]; When animation starts i get black effect here.Please tell me what is the

Why when I set a low duration value for my CABasicAnimation does it jump?

旧巷老猫 提交于 2019-12-07 04:13:39
问题 Sample Project: http://cl.ly/1W3V3b0D2001 I'm using CABasicAnimation to create a progress indicator that is like a pie chart. Similar to the iOS 7 app download animation: The animation is set up as follows: - (void)drawRect:(CGRect)rect { [super drawRect:rect]; CGFloat radius = CGRectGetWidth(self.frame) / 2; CGFloat inset = 1; CAShapeLayer *ring = [CAShapeLayer layer]; ring.path = [UIBezierPath bezierPathWithRoundedRect:CGRectInset(self.bounds, inset, inset) cornerRadius:radius-inset].CGPath

CABasicAnimation creates empty default value copy of CALayer

穿精又带淫゛_ 提交于 2019-12-07 00:06:28
I have a custom CALayer that draws radial gradients. It works great except during animation. It seems that each iteration of CABasicAnimation creates a new copy of the CALayer subclass with empty, default values for the properties: In the screenshot above, you see that CABasicAnimation has created a new copy of the layer and is updating gradientOrigin but none of the other properties have come along for the ride. This has the result of not rendering anything during the animation. Here's a GIF: Here's what is should look like: Here's the animation code: let animation = CABasicAnimation(keyPath:

How to stop UIView CABasicAnimation in iPhone

风格不统一 提交于 2019-12-06 18:24:47
问题 I have 3 views dynamically created by using for loop. in that i called the below method for rotation animation - (void)runRightSpinAnimationOnView:(UIView*)view duration:(CGFloat)duration rotations: (CGFloat)rotations repeat:(float)repeat; { CABasicAnimation* rotationAnimation; rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"]; rotationAnimation.fromValue = [NSNumber numberWithFloat:0]; rotationAnimation.toValue = [NSNumber numberWithFloat:((360*M_PI)/180)]; /

how to repeat animation forever in Swift (HUGE_VALF)?

血红的双手。 提交于 2019-12-06 16:32:05
问题 According to the docs, the way to repeat a CABasicAnimation forever is to set its repeatCount to HUGE_VALF . But in Swift, HUGE_VALF causes a compile error. Swift doesn't seem to know about the standard library (or wherever this constant resides). What do I do now? 回答1: Set the repeatCount to Float.infinity . This compiles and works. In all probability, HUGE_VALF was a legacy value in any case. Still, it's a bit of a surprise that these numeric constant names are not seen by Swift. I did try

Incorrect position of CAShapeLayer

◇◆丶佛笑我妖孽 提交于 2019-12-06 15:01:21
问题 I have a UIView called viewProgress . It is the white box in the image. I want a circular progress bar, which is the green circle in the image. The progress bar should stay within the white box, but as you can see it is way off. How do I make it stay inside the viewProgress ? Here you have my animation function: func animateView() { let circle = viewProgress // viewProgress is a UIView var progressCircle = CAShapeLayer() let circlePath = UIBezierPath(arcCenter: circle.center, radius: circle

CABasicAnimation disappear when home button is pushed

自古美人都是妖i 提交于 2019-12-06 11:52:13
I'm implementing a game, in which i have some CABasicAnimations. For example, like this : CABasicAnimation * borddroit = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"]; borddroit.fromValue = [NSNumber numberWithFloat:0.0f]; borddroit.toValue = [NSNumber numberWithFloat:749.0f]; borddroit.duration = t; borddroit.repeatCount = 1; [ImageSuivante2.layer addAnimation:borddroit forKey:@"borddroit"]; I put it in pause with this function : -(void)pauseLayer:(CALayer*)layer { CFTimeInterval pausedTime = [layer convertTime:CACurrentMediaTime() fromLayer:nil]; layer.speed = 0.0; layer

Animate progress with filling the color of the border width of a UIImageView layer

寵の児 提交于 2019-12-06 10:09:03
问题 I have am UIImageView and I have made it to be circle with a width layer like in this image : User can update the image and upload new one, I have a progress call back while image is uploaded. What I want is to animate the border with color while the image is uploaded, for example when user click upload the border start from top with green color and fill the width according to the progress. I tried with this code: CAShapeLayer *circle = [CAShapeLayer layer]; circle.path = [UIBezierPath

Animate Background Color Of UIButton from WhiteColor to RedColor

谁都会走 提交于 2019-12-06 02:34:10
问题 I'm trying to making a kind of color pulse effect animating background color of a UIButton to make it change continously from a color (WhiteColor) to another one (RedColor). I'm trying to use CABasicAnimation for changing Opacity but I can't make it work with color too. CABasicAnimation *theAnimation; theAnimation=[CABasicAnimation animationWithKeyPath:@"opacity"]; theAnimation.duration=1.0; theAnimation.repeatCount=HUGE_VALF; theAnimation.autoreverses=YES; theAnimation.fromValue=[NSNumber