IBM Worklight v5.0.5 > Develop IBM Worklight applications > Development guidelines for mobile environments > Web and native code in iPhone, iPad, and AndroidAnimate the transition from a web view to an Objective-C page
To implement a transition animation when switching the display from the web view to the native page implement the methods:
- onBeforeShow
- onAfterShow
These methods are called before the display switches from the web view to the native page, and after the transition.
(void)onBeforeShow { CDVAppDelegate *cordovaAppDelegate = (CDVAppDelegate *)[[UIApplication sharedApplication] delegate]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:[cordovaAppDelegate window] cache:YES]; } (void)onAfterShow { [UIView commitAnimations]; }
Parent Web and native code in iPhone, iPad, and Android