MinuMaster
MinuMaster

Reputation: 1457

How to give page curl animation in webView?

I am working on PDF Reader application. if i display pdf file then i am not able to change font size of this.

So i display ePub file in UIWebView. But my problem is how to add page curl animation in UIWebView like iBook and kindle apps does.

Upvotes: 0

Views: 4199

Answers (1)

Anil Kothari
Anil Kothari

Reputation: 7733

I have created a UIWebView named myWebView and on clicking the button the curl effect will be shown on the webview:-

    -(IBAction) nextPageAnimationForWebView{        
    CATransition *animation = [CATransition animation];
    [animation setDelegate:self];
    [animation setDuration:1.0f];
    animation.startProgress = 0.5;
    animation.endProgress   = 1;
    [animation setTimingFunction:UIViewAnimationCurveEaseInOut];
    [animation setType:@"pageCurl"];

        //[animation setType:kcat]; 
        [animation setSubtype:kCATransitionMoveIn];

    [animation setRemovedOnCompletion:NO];
    [animation setFillMode: @"extended"];
    [animation setRemovedOnCompletion: NO];
    [[myWebView layer] addAnimation:animation forKey:@"WebPageCurl"]; 

}

Please tell if this solved your answer.

Upvotes: 6

Related Questions