如何创建卷页动画?

发布于 2024-10-07 08:04:13 字数 113 浏览 0 评论 0原文

有什么办法可以模拟这样的事情吗?没有一个 API 可以执行“半页卷曲”之类的操作吗?

替代文本

Any way to emulate something like this? Isn't there an API for doing something like a "Half page curl" or something?

alt text

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

昵称有卵用 2024-10-14 08:04:13
controller.modalTransitionStyle = UIModalTransitionStylePartialCurl;
[self presentModalViewController:controller animated:YES];

UIModalTransitionStyle
以模态方式呈现视图控制器时可用的过渡样式。以下是四种不同的过渡样式。 “UIModalTransitionStylePartialCurl”就是您想要的。

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

苹果文档: http://developer.apple.com/library/ ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html

希望这有帮助!

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!

安人多梦 2024-10-14 08:04:13

尝试以下操作。在本例中,Settings 是要在卷页后面呈现的子类 UIViewController。 self 也是一个正在显示的 UIViewController,它的视图将保持在顶部。

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

请注意,Curl 仅在 iOS 3.2 及更高版本中可用。

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.

赠我空喜 2024-10-14 08:04:13

我想这可能就是您正在寻找的:

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

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];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文