Topic
  • 2 replies
  • Latest Post - ‏2013-02-04T20:30:05Z by SystemAdmin
SystemAdmin
SystemAdmin
2327 Posts

Pinned topic [WL 5.0.5] How to open native iOS page with animation

‏2013-02-04T13:54:35Z |
Hi

I'm opening a native iOS page from an hybrid app with this code :


WL.NativePage.show(className, backFromNativePage, params);


This works great, but what I want is to load this page with a flip animations.
I set it up for the "close" event, with this code :


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;
NativePage showWebView:nil;


So how can I do the same for the "open" event ?

Thanks for your help :)
  • christianIBM
    christianIBM
    78 Posts

    Re: [WL 5.0.5] How to open native iOS page with animation

    ‏2013-02-04T17:08:29Z  
    Just add these methods to your class :

    
    -(
    
    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]; 
    }
    


    -Worklight Development Team, iOS-Christian Linares
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: [WL 5.0.5] How to open native iOS page with animation

    ‏2013-02-04T20:30:05Z  
    Awesome, thank you Chritian