I wonder what would happen. i.e. I kick off a CAKeyframeAnimation, and while it runs I kick off another one on the same keyPath and object. I want it to pick up the current state, but unlike in the nice UIView CA wrapper methods, I don't see a "beginsFromCurrentState" property. So would it pick it up or not?
...
The documentation is very poor on this. What's the effect of these? The only thing that seems to work as expected is kCAAnimationLinear. What can I do with the others, for example?
...
I have one like this:
CALayer *layer = stripeButton.layer;
CAKeyframeAnimation *moveAnim = [CAKeyframeAnimation animationWithKeyPath:@"bounds.origin.y"];
moveAnim.duration = 3.35;
moveAnim.repeatCount = 0;
moveAnim.autoreverses = NO;
moveAnim.removedOnCompletion = NO;
moveAnim.calculationMode = kCAAnimationLinear;
moveAnim.fillMode = kC...
I have a custom NSView subclass that I want to animate with Core Animation. I am already (without CA) setting the position and rotation of these views with NSView's setFrameOrigin and setFrameRotation methods. However, no matter what I do, once I add a layer backing to the views I can't get them to rotate.
I've tried using NSView's setF...
I'm trying to make a bobble head app, but I don't know how to use the movement technology..
Any thoughts?
Thanks
...
Implicitly things behave fine. But when i try to use explicit animations to do multiple animations on a single layer (e.g. opacity and translation) I get odd results.
First of all, i tried using CATransaction. Then i switched to CAAnimationGroup. Both doesnt seem to get what i want.
What do I want?
All i want is for a layer to move fro...
I have a UIView with a large number of CALayers (~1000), each of which has a small image as its contents. This UIView is a subview of a scrollview (actually it's a subview of another view which is a subview of the scrollview). This draws relatively quickly at first (couple seconds). However when I scroll in the scrollview the frame ra...
This is the strangest error i have come across.
Am trying to add a countdown animation onto a Class that extends UIView. The code is shown below:
NSArray *myImages = [[NSArray alloc] initWithObjects: [UIImage imageNamed:@"3.png"], [UIImage imageNamed:@"2.png"], [UIImage imageNamed:@"1.png"], [UIImage imageNamed:@"Go.png"], nil];
UIIma...
Can you guys tell why this code shows no image?
CALayer *layerBack = [CALayer layer];
addedObject = [[UIImage alloc]initWithContentsOfFile:[[NSBundle mainBundle]
pathForResource:[NSString stringWithFormat: @"%@%d", PREFIX, number] ofType:@"png"]];
layerBack.bounds=CGRectMake(0.0f,0.0f,selectedImage.size.height,selectedImage.size....
How do you stop the rotation of a custom drawn CALayer on the iPhone?
This
CATransform3D pausetransform = ((CALayer *)[layer presentationLayer]).transform;
[layer removeAllAnimations];
layer.transform = pausetransform;
stops the animation, then immediately rotates the layer back a little bit. Probably because after the pausetransform...
Is that possible to have a CALayer over another one composed using a blending mode on screen?
I now that it is possible to do that offscreen using drawinrect, but is it possible to see it live on the screen?
thanks for any help.
...
I'm working on a Snow Leopard app and I'm doing some view animations (swapping them) and I've seen some older examples using NSViewAnimation. I'm wondering if these are completely obsoleted by Core Animation?
It seems fairly simple for me to use
[[myView animator] setFrame:newSwapFrame];
But I'm just wondering if I'm missing somethin...
I am using this code for rotate animation:
CABasicAnimation *spinAnimation = [CABasicAnimation
animationWithKeyPath:@"transform.rotation.z"];
spinAnimation.fromValue =[NSNumber numberWithFloat:0];
spinAnimation.toValue = [NSNumber numberWithFloat:3.30];
spinAnimation.duration =2;
[imgArrow.layer addA...
I am using this code to rotate a needle (like in a speedometer):
CALayer* layer = someView.layer;
CABasicAnimation* animation;
animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
animation.fromValue = [NSNumber numberWithFloat:0.0 * M_PI];
animation.toValue = [NSNumber numberWithFloat:1.0 * M_PI];
animation.dura...
I want to remove an animation (CABasicAnimation) before it has completed.
For example:
In my code, I start a needle animating from a rotation value of 0 to a target value of 5. How do I stop the animation when the needle reaches a rotation value of 3?
CALayer* layer = someView.layer;
CABasicAnimation* animation;
animation = [CABasicA...
I'm slightly confused when to use CALayer on the iPhone or Mac and when not to use it? CoreAnimation works just fine on my UIView based objects without having to use CALayer. When is the appropriate time to dig into this class?
...
I setup a UITableView which does the following when you tap a section header:
Expand the section (inserting rows animated)
Scroll to the first item in that section also animated
Like this:
[self.tableView beginUpdates];
//Expand
[self.tableView insertRowsAtIndexPaths:ips withRowAnimation:UITableViewRowAnimationFade];
[self.table...
Hello all, I've built a very cool looking animation for an end-game state in my (very first) app using CALayers that i'm now looking for a way to speed up - on a 3G iPhone this runs at ~15fps which is ok but on the 3GS it runs at 60fps which looks silky. set-up of the layers/animations below:
The 'background' of the app has two layers e...
I'm looking for something that does a similar call, but using cocos2d... the idea is to enlarge the sprite and then fade it out... Here's is a similar call in core animation:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:ANIM_NORMAL];
someView.alpha = 0.0;
someView.transform = CGAffineTransformMakeScale (3.0, 3....
I'm trying to delete a section from a UITableView using animation and custom table section header UIViews.
I use...
//Deletion from my model done here (not shown) and then perform the deleteSections...
[self.tableView beginUpdates];
[self.tableView
deleteSections:[NSIndexSet indexSetWithIndex:index]
withRowAnimation:UITableViewRow...