• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Resetting of property values after completion of a CABasicAnimation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Resetting of property values after completion of a CABasicAnimation


  • Subject: Resetting of property values after completion of a CABasicAnimation
  • From: Vincent Coetzee <email@hidden>
  • Date: Tue, 13 Nov 2007 13:13:29 +0200

Dear List,

I am using a CABasicAnimation to fade an item out. I am setting the opacity to 1.0 in the fromValue and to 0.0 in the toValue.The animation works perfectly and the item fades out, however once the animation has completed, the property (in this case opacity) seems to get reset to the original value of 1.0 so my item sudden pops back before I get a chance to remove it completely. I have tried everything I can think of to stop this irritating flash to no avail. I list my code below. Any suggestions / criticisms would be very welcome.

TIA

Vincent

- (void) fadeOut
{
CABasicAnimation *theAnimation;
ItemAnimationContext* context;

theAnimation=[CABasicAnimation animationWithKeyPath:@"opacity"];
theAnimation.duration=1.0;
theAnimation.fromValue=[NSNumber numberWithFloat:1.0];
theAnimation.toValue=[NSNumber numberWithFloat:0.0];
context = [ItemAnimationContext onAnimation: theAnimation endAction: @selector(fadeOutCompleted:) onItem: self];
[theAnimation setDelegate: context];
[[self layer] addAnimation:theAnimation forKey:@"animateOpacity"];
}
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Resetting of property values after completion of a CABasicAnimation
      • From: Bill Dudney <email@hidden>
  • Prev by Date: Dynamic UI: can it be done in Cocoa
  • Next by Date: how to convert double to int?
  • Previous by thread: Re: Dynamic UI: can it be done in Cocoa
  • Next by thread: Re: Resetting of property values after completion of a CABasicAnimation
  • Index(es):
    • Date
    • Thread