Re: iPhone UIView: How do I animate the addition/entrance of a window's subview?
Re: iPhone UIView: How do I animate the addition/entrance of a window's subview?
- Subject: Re: iPhone UIView: How do I animate the addition/entrance of a window's subview?
- From: Robert Marini <email@hidden>
- Date: Thu, 8 Jan 2009 17:11:44 -0500
You can initialize the view with a frame that is positioned off screen
and then use implicit animation to bring it in. Alternatively, a
subtler approach would be to animate it's appearance in by animating
the change in alpha value from 0 to 1. For instance -
scanView.alpha = 0.0;
[UIView beginAnimations:@"fadein" context:nil];
[UIView setAnimationDuration:0.5f];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDelegate:self];
// Change any animatable properties here
scanView.alpha = 1.0;
[UIView commitAnimations];
Note that if you do want to accomplish the effect you're after, you
can't directly animate the view's frame property but should instead
modify its position. Take a look at the Core Animation Programming
Guide (specifically, animatable properties) for more information.
-rob.
On Jan 8, 2009, at 1:22 PM, email@hidden wrote:
Background:
@interface ScanView : EAGLView <AbstractViewProtocol,
ScannerDelegate> <--- subclass of UIView.
---------
The following code is typical for loading the 'scanView' subView
into its parent window:
[window addSubview:scanView]; // ...this is what I'm doing now.
The end result is a brief flash of void/black background before the
view is displayed.
I want to avoid this by animating the appearance/entrance of
'scanView' before the user.
For example, sliding from the right --> left into view.
I'm not sure how to tackle this.
Any ideas would truly be appreciated!
Ric.
<I'm assuming that iPhone's NDA has ended, hence use of Cocoa Dev
forum>
_______________________________________________
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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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