开发者

How to create a page curl animation?

Any way to emulate something like this? Isn't there an API for doing something like a "Ha开发者_JS百科lf page curl" or something?

How to create a page curl animation?


controller.modalTransitionStyle = UIModalTransitionStylePartialCurl;
[self presentModalViewController:controller animated:YES];

UIModalTransitionStyle Transition styles available when presenting view controllers modally. The below are the four different transition styles. The "UIModalTransitionStylePartialCurl" is the one you're after.

typedef enum {
    UIModalTransitionStyleCoverVertical,
    UIModalTransitionStyleFlipHorizontal,
    UIModalTransitionStyleCrossDissolve,
    UIModalTransitionStylePartialCurl,
} UIModalTransitionStyle;

Apple documentations: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html

Hope this helps!


Try the following. In this case Settings is a sublcass UIViewController to be presented behind the page curl. self is also a UIViewController that is being displayed an it's view will stay on top.

-(void)presentSettings{
    Settings *eset = [[Settings alloc] init];
    //eset.modalPresentationStyle = UIModalPresentationFullScreen;
    eset.modalTransitionStyle = UIModalTransitionStylePartialCurl;
    [self presentModalViewController:eset animated:YES];
}

Notice that the Curl is only available in iOS 3.2 and later.


I think this may be what you're looking for:

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
[UIView commitAnimations];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜