IBM Worklight v5.0.5 > Develop IBM Worklight applications > Development guidelines for mobile environments > Web and native code in iPhone, iPad, and Android

Animate the transition from an Objective-C page to a web view

To implement a transition animation when switching the display from the native page to the web view, within the animation code, call the [NativePage showWebView] method.

-(IBAction)returnClicked:(id)sender{
NSString *phone = [phoneNumber text];
NSDictionary *returnedData = [NSDictionary dictionaryWithObject:phone forKey:@"phoneNumber"];

// Animate transition with a flip effect
CDVAppDelegate *cordovaAppDelegate = (CDVAppDelegate *)[[UIApplication sharedApplication] delegate];

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight
forView:[cordovaAppDelegate window] cache:YES];

[UIView commitAnimations];

// Return to WebView 
[NativePage showWebView:returnedData]; }


Parent Web and native code in iPhone, iPad, and Android





+

Search Tips   |   Advanced Search