core-animation

Failed Attempt to use Perspective Transformations in Core Animation

I'm trying to create a simple iPhone app that displays a picture with a reflection beneath, and I want to rotate the picture around the X axis, using Core Animation. I've started by creating a new iPhone app using the "View-based Application" template. I added a "Picture.jpg" image file, and then I added this to the view controller: -...

Rotating NSView that holds an NSImageView

Hi All, I am creating an NSView, which in its drawRect method creates and adds an NSImageView as a subview. I would like to rotate this NSImageView (circleView), or [self]. So in another method, I am trying to do that: -(void)startAnimation { CABasicAnimation* spinAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation...

How to know when a Core Animation has finished?

say I have... [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; CGPoint position = myObject.center; position.x = position.x - 10; myObject.center = position; [UIView commitAnimations]; Core animation happens on a separate thread is there a way to know when an animation has finished? i.e., maybe there's...

Moving Between Multiple XIB Files

Hi, It's my understanding that in order to move between xib files one usually uses either a Navigation Controller, Tab Controller, or Flipside Controller or combination of them. But my question is- can I write my own custom controller, and use Core Animation to move between Views or are these default controllers (navigation/tab/flipsid...

Is this possible with the Navigation Controller?

I'm using the navigation controller project. I'd like to have a main menu without the Navigation Controller bar. But other screens SHOULD have the navigation bar. I did this by setting the viewDidLoad in my RootViewController to: self.navigationController.navigationBarHidden = YES; And inside viewDidLoad in my childController to: se...

iphone Animation: why does rotating a UILabel around X axis cut off its bottom half?

I want to rotate a UILabel around the X axis, and animating it. But when the animation starts, the text of the label is cut in two, horizontally. The bottom half disappears, the upper half is rotating. Why? Here's the code: CATransform3D _3Dt = CATransform3DMakeRotation(radians(90.0f), 1.0, 0.0, 0.0); CABasicAnimation *transformAnimat...

Is there a way to pause a CABasicAnimation?

I have a basic spinning animation of the iPhone. Is there any way that I can "pause" the animation so that the position of the view will be maintained? I guess one way of doing this would be to cause the animation to "complete" instead of calling "remove" on it, how would I do that? CABasicAnimation* rotationAnimation; rotationAnimation...

Changing the text of a UILabel when its superview is being animated.

Is it possible to alter the text of a UILabel whist its superview is being animated by UIView animations? Say I have labelView as a sub view of containerView. timerFired is being called during containerView being animated (never before or after). I'm calling setText of labelView during the animation, but its text doesn't change. Is ther...

programaticlaly moving rows with animation in UITableView

Hi, I want to move a row to the bottom of my UITableView with cool animation effect just like in Grocery Shopping List app. How can I create such animation? -Alex ...

How to replace the custom animation for a CALayer appearing

I have a CALayer that I want to change the custom animation for it appearing on screen. I have created a delegate so that I can catch the method: - (id < CAAction >)actionForLayer:(CALayer *)layer forKey:(NSString *)key And I check for the key to be equal to kCAOnOrderIn, however, the layer hasn't been told what it's bounds will be ye...

Source of UIView Implicit Animation delay?

I have a block of UIView animation code that looks like this: [UIView beginAnimations:@"pushView" context:nil]; [UIView setAnimationDelay:0]; [UIView setAnimationDuration:.5]; [UIView setAnimationDelegate:self]; [UIView setAnimationWillStartSelector:@selector(animationWillStart)]; view.frame = CGRectMake(0, 0, 320, 416); [UIView commit...

How can I replicate the Swing(Needle) animation of VoiceMemo.app?

Hello all, I want to create an application in which i want to record user voice.I want to do the same naimation as voiceMemo application does on iphone when we record sound? any sample code would be appreciated. Thanks. ...

iphone view flipping: viewflips from top to bottom instead of right to left

Hello everyone i try to build a app that is in landsscape mode all the time. I did the usual stuff: plist added UIInterfaceOrientation / UIInterfaceOrientationLandscapeRight rotated the XIBs in interface builder with the little arrow in top of view. my code for launching: - (void)applicationDidFinishLaunching:(UIApplication *)applicati...

Using Core Animation with objects other than CALayers

I was pretty sure I had seen discussions of this around the Net, but now I can't seem to find anything. The question is simple: is there a way to use for example CABasicAnimation to animate a property on an object that's not a ´CALayer´? (Say, the ´volume´ property on an ´AVAudioPlayer´.) If not, is there a way to make it work other tha...

How do I create and apply the image skew transform that I have calculated?

Hi, I already asked this question and Kenny gave me a good answer (many thanks to him), but I still in confusion about the final realization. So, the question is - how to get access to the matrix of the certain pixel in the image. I translated Kenny's sample to the Objective-C: - (NSArray *) compute_transform_matrix:(float)X Y:...

Blind down animation on CALayer using a mask

Hi there, I want to create a "blind down" effect on an image so the image "blinds down" and appears. Sort of like this JavaScript transition: http://wiki.github.com/madrobby/scriptaculous/effect-blinddown The mask is setup correctly because if I manually change it's position it hides and reveals the image behind it, but it doesn't ani...

Leveraging Core Animation for Animation in OpenGL

I'm interested in using Core Animation to drive custom animations in my OpenGL scene on the iPhone. I was hoping to find a mechanism that allowed you to generically animate a keypath of an NSObject or a delegate method for each animation tick. What I have come up with is to animate an arbitrary property of a CALayer and poll them from Op...

How do i rotate a CALayer around a diagonal line?

Hi. I'm trying to implement a flip animation to be used in board game like iPhone-application. The animation is supposed to look like a game piece that rotates and changes to the color of its back (kind of like an Reversi piece). I've managed to create an animation that flips the piece around its orthogonal axis, but when I try to flip i...

Animating a custom property of CALayer subclass

I have a CALayer subclass, MyLayer, that has a NSInteger property called myInt. I'd really like to animate this property via CABasicAnimation, but it seems CABasicAnimation only works on so-called "animatable" properties (bounds, position, etc). Is there something I can override to make my custom myInt property animatable? ...

Wrapping/warping a CALayer/UIView (or OpenGL) in 3D (iPhone)

I've got a UIView (and thus a CALayer) which I'm trying to warp or bend slightly in 3D space. That is, imagine my UIView is a flat label which I want to partially wrap around a beer bottle (not 360 degrees around, just on one "side"). I figured this would be possible by applying a transform to the view's layer, but as far as I can tell,...