Iphone – UIView Transitions Animations

iphoneiphone-sdk-3.0

Hai all,

SecondView *sv=[[SecondView alloc] initWithNibName:@"SecondView" bundle:nil];
[self presentModalViewController:sv animated:YES];

i like change the default animation (pop up from bottom) to fade or UIViewAnimationCurveEaseInOut

thanks in advance

Best Answer

from the documentation at apple's iphone dev site:

Sets the modalViewController property to the specified view controller. Resizes its view and attaches it to the view hierarchy. The view is animated according to the transition style specified in the modalTransitionStyle property of the controller in the modalViewController parameter.

here are your options if you want to use what Apple gives you:

typedef enum {
   UIModalTransitionStyleCoverVertical = 0,
   UIModalTransitionStyleFlipHorizontal,
   UIModalTransitionStyleCrossDissolve,
} UIModalTransitionStyle; 

anything else, and you'll have to do it manually, which isn't too hard. First load your new view in the current or a new view controller. Set it to its initial state, start an animation block, call:

+ (void)beginAnimations:(NSString *)animationID context:(void *)context

do whatever transformations you want then:

+ (void)commitAnimations

more info on the documentation for UIView:

UIView Class Reference

Related Topic