core-animation

Hiding/Removing/Fading CALayer erasing NSView contents

My situation: I have a single window with a content view (NSView), which has several subviews (plain NSControl subclasses; not important, just for testing) scattered around it. For part of the end effect I am trying to achieve, I want to place a semi-transparent black CALayer overlaying the whole window's content view, and be able to m...

Getting the rect of the rotated view in willAnimateFirstHalfOfRotationToInterfaceOrientation:duration:

I am trying to animate between portrait and landscape orientations by hooking the various autorotation methods in UIViewController. Due to some subtleties of my view hierarchy, I'd like to set the frame of a child UIScrollView in the first half the animation and then scroll into position during the second half. This requires knowledge ...

Can't set cornerRadius AND shadow on layer that has an image view stretched to its bounds?

This is stumping me. I have a UIView (call it "parent"). The bottommost subview of that view is a UIImageView (call it "child"), whose frame occupies the entirety of the "parent" bounds. I want to round the corners on the "parent" view, and set a drop shadow. I do this on the CALayer of "parent" as usual: [[parent layer] setShadowOffse...

replaceSublayer example

I have the following code and I can't seem to get it to work. First I create a view with a layer. UIView *view = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 100)] autorelease]; CAGradientLayer *gradient = [CAGradientLayer layer]; gradient.frame = view.bounds; gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor blackColor...

Objective c - Rotate wheel using radians

Hi, I am trying to make a circle image which rotates when the user drags the wheel This is my code: CABasicAnimation *rotationAnimation; rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; rotationAnimation.toValue = [NSNumber numberWithFloat:angleRadians]; rotationAnimation.duration = 10; rotationAnima...

How to add CIFilter to CALayer

Hi Friends I am new to core animation , i add some layers to my view and add image to it. Now i want to give blur effect to my layer But i don't know how to make CIFilter and add it. I go through the related questions Question 1 Question2 My code is given below (Shows compilation error) #import < UIKit/UIKit.h > #import < Quartz...

iOS 4.2: Flip image using block animations

I had this piece of code im my app: [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:imgView cache:YES]; imgView.image = img2; [UIView commitAnimations]; But use of this method is discouraged in iOS 4.0 and later, and I should u...

How do you create an animation like the iBooks app's moving bookmark?

When you tap the bookmark, it slides down or up smoothly. As it slides up, it disappears as if behind the view directly above it. I know how to animate changing the frame of a view, but I don't know how to make it disappear like that. (I don't want to resize the UIImage, just slide the UIImageView up and out of sight.) I figure I need a...

Access interim points while UIView is animated

Hi, I'm animating an image in an UIImageView. This works just great with Core Animation. Now I want to attach one end of a line permanentely to the center of this UIIMageView. But with Core Animation I only get the starting point and the end point of the UIImageView. Is there a possibility to access interim points during the animation? ...

How to animate the background color of a UILabel?

This looks like it should work, but doesn't. The color turns green at once. self.labelCorrection.backgroundColor = [UIColor whiteColor]; [UIView animateWithDuration:2.0 animations:^{ self.labelCorrection.backgroundColor = [UIColor greenColor]; }]; ...

CALayer transformation - anchorPoint problem

Hi there, I work on a card flip animation with CoreAnimation. The layer I want to animation is a UIView with UIImageViews as subviews. The animation approach: CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"]; animation.duration=2.0f; animation.repeatCount=1; animation.fromValue = [NSValue valueWithCATr...

CABasicAnimation is ignored during rotation

I have a UIView that in the layoutSubviews method repositions its subviews based on the orientation of the iPad. Within the layoutSubviews method I have a CABasicAniamtion that is supposed to animate the repositioning of the subviews. The animations are set to specific duration but this duration is being ignored and repositioning happe...

What is "-[UIApplication beginIgnoringInteractionEvents] overflow. Ignoring."?

After adding about 25 animation blocks within a for loop, there are a lot of -[UIApplication beginIgnoringInteractionEvents] overflow. Ignoring. messages showing in the Xcode debug window. What does the message mean? Can I safely ignore them? Thanks! ...

Sequence of CAAnimations - layer returns to initial position between subsequent calls

Hello! I'm trying to create an endless animation of layer rotating slightly to the left, then slightly to the right and back. So I'm animating 10 degress to the left, then 20 to the right, then 10 to the left again. It works great on simulator, but on device the layer "shivers". It appears like it returns to its previous state every ti...

Fish Eye Effect With Core Animation?

I am trying to achieve an effect similar to the globe of the ABC News iPad app. (Google Images Examples) Is it possible to get this effect by transforming CALayers? Or is this using OpenGL and fragment/vertex shaders? CALayer provides access to the transformation matrix, is there some math that can be applied to this rather than transf...

Nested animation block caused "Segmentation fault"

I try to show three images, one after one, with the following code: image_1.alpha = 0.0; image_2.alpha = 0.0; image_3.alpha = 0.0; [UIView animateWithDuration:0.25 animations:^{ image_1.alpha = 1.0; } completion:^(BOOL finished) { [UIView animateWithDuration:0....

Mysterious borders during MKMapView animation

I have a UIView in which I flip between a UITableView and a MKMapView. The MKMapView is created at runtime and animated in the following function: [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; [UIView setAnimationTransition:(self.mapView == nil ? UIViewAnimationTransitionFlipFromRight : UIViewAnimationTra...

How to make a CATransform3dMakeRotation rotate the other way? And chain together...

I'm working with some Core Animation for the first time and in the process of implementing a playing card that I can flip around, I've decided to use a CALayer to display the contents (not sure how I'm going to get two sides, but that's another question) and I need to be able to flip it over, move it, etc... I'm using CATransaction with...

How to let a view rotate forever?

Is there a way to let a view rotate forever, with an specified speed? I need that for an indicator kind of thing. I know there is this weird Lxxxxx00ff constant (don't remember it exactly) that stands for "forever". ...

How to get text in a CATextLayer to be clear

I've made a CALayer with an added CATextLayer and the text comes out blurry. In the docs, they talk about "sub-pixel antialiasing", but that doesn't mean much to me. Anyone have a code snippet that makes a CATextLayer with a bit of text that is clear? Here's the text from Apple's documentation: Note: CATextLayer disables sub-pixel an...