tags:

views:

345

answers:

1
CATransition *animation = [CATransition animation];
  [animation setDuration:0.5];
  [animation setType:kCATransitionPush];
  [animation setSubtype:kCATransitionFromBottom];
  [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];

  [animation setDelegate:self];


  [[self layer] addAnimation:animation forKey:@"popUpAni"];

The above code (contained within an object of UIView class) fades the view in. I want it to slide in, not fade.

No matter what I try:

        [animation setType:kCATransitionMoveIn];
  [animation setSubtype:kCATransitionFromTop];

The result remains the same. Am I doing something wrong?

A: 

EDIT: Sorry, I had that backwards, I meant to say the curlup animation shows as a fade animation on the simulator...

I know for sure the slide animation, just as you've written it, works on the simulator and of course the device. The code in my project is practically verbatim to yours.

Try changing the key you specify in the addAnimation method from "popUpAni" to something else. If that key is used somewhere else in your project, it may be causing this issue.

Also, have you confirmed you are using the correct version of the CoreAnimation Framework? You should be referencing and the QuartzCore.framework reference should be looking within the iPhoneOS frameworks folder.

Ken Pespisa
I don't want the view to fade in, I want it to slide.
Oliver
I changed the key but the result remained the same.The strange thing is, I had it working briefly not long after I'd made the original post. The only difference in the code: I'd set the UIView's background colour to black! There's something about this that escapes my understanding. I tried it again, back to fades.CoreGraphics and QuartzCore are there. They're the only versions I have installed on my system.For the sake of voodoo, I'm going to update Xcode tonight.
Oliver
Yeah, that's baffling. Updating Xcode can't hurt - there's a new version out anyway for the new iPhone update.
Ken Pespisa
No. The update did nothing. Still fading.
Oliver