How to give page curl animation in webView?

眉间皱痕 提交于 2019-12-18 09:50:15

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/8178378/how-to-give-page-curl-animation-in-webview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!