core-animation

Unable to disable animation of CALayer>>removeFromSuperlayer

I wish to remove a CALayer from its superlayer without animating. What happens here is the layer animates to a position, works great, when however the animation stopped, this code is executed, which returns the layer to its start position, and fades out; presumably then gets removed from the superlayer. How may it be stopped from animati...

Load entire image and use CATiledLayer

Hello, I'm not sure I did understand that very well in the Apple doc. I'm considering using CATiledLayer to display a JPEG image. However, I only have an entire JPEG file at my disposal and no small tiles. Is it still possible to use a CATiledLayer and let it "tile" the JPEG? Thanks! ...

Going nuts with XCode animation chain

Hi gang, I am trying to do a very simple animation, but it is giving me much grief... I must be doing some simple thing wrong and just missing by a bit my desired result. As posted here: Rotating around a diagonal axis I was trying to re-create a "Reversi" piece - a square which when activated would rotate about the axis Y=X, and cha...

iPhone - CALayer animating the Bounds

Hi guys, Is it possible to animate the bounds of the CALayer on iPhone? How to implement that? Thanks! ...

Core Animation Callbacks

I'm using core animation to transition between different view states in my application. However, I need to find a way to perform different tasks after the animations finish. I understand I can implement a delegate method and use the - (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag; callback, however there's no ...

Modifying/Animating a UISplitView on iPad - Navbar issues

I am creating an iPad application using a UISplitView. I used the default template for that type of application in Xcode. The UISplitView has a left pane (menu or list) and a right pane (detail or content view) in it. Each has a navigation bar at the top of the view. What I want to do is move (with animation) both views to the left so t...

How to reduce the duration of an implicit animation to 0 for a CAReplicatorLayer

I've got a CAReplicatorLayer replicating its sublayer as per expected, but there's a built-in duration to the animation that I want to turn off. In other words I want to see the instantaneous results of replicating the base layer, rather than over the time duration that's implicitly specified by Apple. Here's the replication code, brack...

Animate between two states of a view, using custom animation

Hi, I would like to animate between two states of a view. Say, for example, I have a view with a label and when I change the text of the label an animation renders that change as a page flipping. Now you can of course do this with a [UIView setAnimationTransition:forView:cache:]: - (IBAction)nextPage { [UIView beginAnimation:nil...

Rotate and Scale UIImageView with animation

How can I get a UIImageView to rotate itself 90° counter-clockwise and have the same UIImageView scale to fill the entire iPhone screen with animation at speeds of one-second? ...

Why won't my layer animate about the Z axis?

I have an image which I place in a CALayer, then add that layer as a sublayer of the main view. When I try to animate it around its Z axis, all I see is a static image. Why won't my layer animate? The relevant code is as follows: - (void)viewDidLoad { UIImage *myImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] p...

NSWindow that is unaffected by Expose

Is there any way to make a window completely unaffected by Expose, just like the Dock? Setting the level to NSDockWindowLevel doesn't help. I know about NSWindowCollectionBehaviorStationary, but I want the window not to fade when Expose is active. If it is not possible, is there any way to "unfade" the window after Expose fades it? ...

Color gradient of a line with CoreGraphics

I need a line that changes color along the path (which could be approximated by a linear gradient in one direction, if that is easier). Is it possible to draw the path of a CAShapeLayer so that it has a color gradient? ...

Can a CGImage be added to the contents property of a CAShapeLayer?

I have a custom view with a layerClass override like: + (Class) layerClass { return [CAShapeLayer class]; } I want to be able to add a CGImage to the contents property like so: - (void) animateView { UIImage *layerImage = ...; CAShapeLayer *layer = (CAShapeLayer *)self.layer; layer.contents = layerImage.CGImage; ...

CALayer valueForKey:

Hi, How different is the behavior of CALayer's valueForKey from that of any other ordinary NSObject's? I have a custom layer which inherits from CALayer, and that has a property named 'angle', but [myLayer valueForKey: @"angle"] always returns nil while [myLayer angle] returns the right value. ValueForKey: works as intended with a class ...

Core Animation image change in IKImageView?

Is there any way to animate (using one of the supplied Core Animations) an image change in IKImageView without resorting to using two independent IKImageViews upon a new image load? ...

animating a custom CALayer property

Hi, I'm trying to define an abstract layer property, angle, based on the existing layer property position. Basically it describes the orientation of the layer from the center of a circle. I did like the following: @interface MenuItemLayer : CALayer @property CGFloat angle; @end @implementation MenuItemLayer + (BOOL)needsDisplayForKe...

Restart CoreAnimation after view appears

I have a custom view with additional layers and a simple endless animation (using core animation). The view is a subclass of UITableViewCell and therefore doesn't have it's own view controller. The animation gets stopped whenever the view disappears, which is fine. But how do I restart the animation when the view reappears? ...

Drawing a prism with CoreAnimation

I'm trying to draw a prism and animate it with CoreAnimation. But I can't find a good solution to draw the fan of rainbow colors. There a a couple of ways to do that, each of them has disadvantages: I could simply use an image. But I allow the user to zoom into the scene and I'd like to avoid any artefacts. Using a CAGradientLayer ...

Rotate main screen and rotate back subview

How can I rotate my base view and still make sure that its subviews are still in their correct locations? -------- |X | After 90 degree rotate and stretch | | this should remain the same | | | Y| -------- I presume I need to rotate 90 degrees and stretch according to window ratio and p...

CoreAnimation fade "jerky" on OS X Leopard (CPU 100%)

I've made a screensaver which displays tables of statistics across a number of "screens" which it fades between. I've used only CALayers and implicit animation, but even so the animation is jerky at best; rather than a smooth transition there are 3 "jumps" between screens, one at ~5%, one at ~30%, then 100%. Running top in a terminal fr...