> Date: Mon, 09 May 2011 21:43:38 +0800
> From: Roland King <r...@rols.org>
> Subject: transitionWithView:duration:options:animations:completion:
>       still defeats me
> 
> I seem to have a lot of trouble with this method! A few months ago I had my 
> own custom drawRect: and that was messing it up, this time I just have a 
> simple UIView with some controls on it, nothing clever. One of the controls 
> is given by the property 'complexity'. What I want is for my UIView to rotate 
> and show up with/without that control. However whatever I have tried all that 
> happens is the control instantly disappears or reappears, no transition at 
> all. Here's the code ..
> 
>       [ UIView transitionWithView:factorsView 
>                                          duration:2.0f 
>                                               options:( 
> UIViewAnimationTransitionFlipFromRight | 
> UIViewAnimationOptionAllowAnimatedContent )
>                                        animations:^{ [ [ factorsView 
> complexity] setHidden:![ [ factorsView complexity ] isHidden ] ]; } 
>                                        completion:NULL         
>        ];
> 
> factorsView is the UIView subclass and it's displayed and it's on screen.
> 
> I've tried with and without the AllowAnimatedContent option. The factorsView 
> never rotates, it stays right where it is, and the complexity subview just 
> winks in and out of existence. 

The key thing is to ask for the factorsView to be redrawn. Otherwise you're not 
doing anything to it that can trigger animation. In other words, the animation 
block should consist of [factorsView setNeedsDisplay].

http://www.apeth.com/iOSBook/ch17.html#_view_animation

m._______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to