core-animation

fade View IN and OUT

你。 提交于 2019-12-12 01:19:04
问题 Good Morning everyone, I'm totally confused with this problem. I have 3 UIWebViews and what should hapen is webView1 fades in (that works) fades out und WebView2 fades in...... I made it so far with: CATransition *Animation = [CATransition animation]; [Animation setDuration:4.0]; [Animation setType:kCATransitionFade]; [Animation setSubtype:kCATransitionFade]; [Animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; transitioning = YES; if

How can I animate a UIColor in a CALayer?

对着背影说爱祢 提交于 2019-12-11 18:46:52
问题 I have a custom CALayer within which I'm trying to enable the animation of certain properties using actionForKey and following this tutorial. I have a CGFloat property that will change perfectly when inside an animation block but my other property, a UIColor , will not. Here's my function: - (id<CAAction>)actionForKey:(NSString *)event { if ([self presentationLayer] != nil && [[self class] isCustomAnimationKey:event]) { id animation = [super actionForKey:@"backgroundColor"]; if (animation ==

Why updating CALayer causes increase of CPU usage (by other processes) by 60-70%?

天涯浪子 提交于 2019-12-11 18:35:44
问题 I am witing IOS app when interface is presented by many CALayers . Once I noticed that CPU is loaded by other processes (not app actually) during graphics updates. I began to disabled updating of interface parts and went to the moment when only ONE CALayer was updated (at 50-60 Hz ), but all other layers (hundreds) were statically displayed too. So updating of only this ONE layer costs 60-70% of CPU load by other processes. When disable update of this only layer, CPU is not loaded. Can anyone

Trouble timing two CABasicAnimations together

无人久伴 提交于 2019-12-11 17:39:26
问题 I'm trying to animate the strokeEnd property of one layer, and position of another layer. I've tried to set up two CABasicAnimations with the same duration, but one finishes earlier than the other. I can't for the life of me understand why. CALayer *trackingDotPresentationLayer = (CALayer *)trackingDot.presentationLayer; CABasicAnimation *trackingDotMovementAnimation = [CABasicAnimation animationWithKeyPath:@"position"]; trackingDotMovementAnimation.duration = lineDrawDuration;

zooming animation problem in ScrollView - Ipad

╄→гoц情女王★ 提交于 2019-12-11 16:57:47
问题 In my app, I have a split screen in which the detail view is a scrollview. I have 5 tables which are subviews of my scrollview in which 3 table views are side by side on top and 2 table views are side by side on bottom I have already implemented a way in which when I click any of the rows of any of the table in the scrollview, that view disappears and another view zooms into its position. I write the following code in the didSelectRowAtIndexPath in the middle table subview, CGFloat xpos =

How can I pause a currently running animation?

主宰稳场 提交于 2019-12-11 14:57:22
问题 I have a Core Animation running and want to pause it when a button is pressed. So there is a method -pauseAnimation. When the animation is paused, I want the animated view to stay in the state as it currently was while animating. i.e. if a view moves from top left to bottom right, and somewhere in the middle the animation is paused, the view should stay in the middle. Is there a way to do this? as far as i can remember there is an setAnimationsEnabled=NO option, but that doesn't work when the

Moving/Rotating an object using it's updated position and tilt?

◇◆丶佛笑我妖孽 提交于 2019-12-11 14:43:14
问题 This is basically a simple issue, which I can't get around ... So, I have an object of UIImageView of a certain frame over which, I implement CAAnimation with rotation and translation, and it is at new coordinates (x,y), and has been rotated by some degrees. This animation works beautifully. But if I again do a rotation and movement from THAT state, I want the object to use the new frame and new properties from STEP 1 after its rotation and again rotate by the new angle. As of now, when I try

iOS Core-Animation: Performance issues with CATransaction / Interpolating transform matrices

╄→尐↘猪︶ㄣ 提交于 2019-12-11 14:16:31
问题 I am performance testing my iPhone app: // using CATransaction like this goes from 14fps to 19fps [CATransaction begin]; [CATransaction setDisableActions: YES]; // NEG, as coord system is flipped/messed up self.transform = CGAffineTransformMakeRotation(-thetaWheel); [CATransaction commit]; Question: why does disabling core animation's default behavior of interpolating between the old and the new transform matrix give such a performance boost? What could they possibly be doing that could be so

Animation Sometimes Doesn't Occur

放肆的年华 提交于 2019-12-11 14:12:23
问题 I am building a concentration-like game. The tiles get flipped by a button press. I then check to see if two tiles are flipped. When I don't do the check, the tiles flip as expected. When I do the check, the first tile flips correctly. If the second tile matches the first tile, sometimes the second tile doesn't do its flip animation before they both do their disappear animation. -(void)twoTilesFlipped { NSInteger i = 0; for (i = 0; i < [bottomLayers count]; i++) { if ([[flippedStatus

Disabling CALayer implicit animations

你离开我真会死。 提交于 2019-12-11 13:37:07
问题 The class below is attempting to stop any implicit animations from occurring when a CALayer has a property changed. // NoImplicitAnimations.h #import <Foundation/Foundation.h> #import <QuartzCore/QuartzCore.h> @interface NoImplicitAnimations : NSObject - (id<CAAction>) actionForLayer:(CALayer *)layer forKey:(NSString *)key; @end // NoImplicitAnimations.m #import "NoImplicitAnimations.h" @implementation NoImplicitAnimations - (id<CAAction>) actionForLayer:(CALayer *)layer forKey:(NSString *