有完整的翻页吗?已更新

发布于 2024-11-19 04:23:12 字数 432 浏览 4 评论 0原文

好的,所以我真的很喜欢 pagecurl 效果,只有一个问题,当从应用程序内发送反馈电子邮件时,partialPageCurl 覆盖了取消按钮和邮件的大部分发送按钮。这些按钮仍然有效,但用户看不到它们。有没有办法让partialPageCurl 变成fullPageCurl 几乎完全不在屏幕上?提前致谢!目前我正在推动这一观点。

- (IBAction)HelpClicked{

MoreHelp *More = [[MoreHelp alloc] initWithNibName:nil bundle:nil];

More.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:More animated:YES];

[More release]; 
}

Ok, so I really like the pagecurl effect, only one problem, when sending feedback email from within the app, the partialPageCurl covers the cancel button and most of the send button for the mail. The buttons still work, but the users won't see them. Is there a way to get the partialPageCurl to a fullPageCurl where it's almost completely off screen? Thanks in advance! Here is currently how I'm pushing the view.

- (IBAction)HelpClicked{

MoreHelp *More = [[MoreHelp alloc] initWithNibName:nil bundle:nil];

More.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:More animated:YES];

[More release]; 
}

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

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

发布评论

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

评论(4

稍尽春風 2024-11-26 04:23:12

在苹果的开发者库中查看 UICatalog 代码。这是链接:
http://developer.apple.com/library/ios/#samplecode/UICatalog/ Introduction/Intro.html

当您运行它时,从 UITableView 中选择 Transitions。查看“Curl Image”按钮的操作。如果这就是您所需要的...

您将在 TransitionViewController 类中找到curlAction: 方法。基本上,它在一个视图内有两个图像视图。基于显示哪个图像视图以及上一个转换是什么(向上卷曲或向下卷曲),它以一种看起来像向上卷曲页面然后向下卷曲的方式显示其他图像,我确信您可以将其适应您的 UI

。与PeyloW 的答案只是它使用旧的 setAnimation: commitAnimation 对。

Check out the UICatalog code at apple's developer library. Here is the link:
http://developer.apple.com/library/ios/#samplecode/UICatalog/Introduction/Intro.html

When you run it you, select Transitions from the UITableView. See the action of 'Curl Image" button. If thats what you need...

You will find curlAction: method in TransitionViewController class. Basically it has two imageview inside a view. Based on which one is displayed and what was the previous transition (curl up or curl down), it displays the other image in a manner that it looks like you curl a page up and then curl it down. The curl imageview completely disappears. Im sure you can adapt it to your UI.

Its pretty much the same as PeyloW's answer only it uses the old setAnimation: commitAnimation pair.

指尖上的星空 2024-11-26 04:23:12

不,UIModalTransitionStyle 没有整页卷曲变体。

如果这是您所需要的,那么您必须自己手动实现。它比做一个简单的模态视图控制器更复杂,但也是可行的。

这段代码仅适用于默认的纵向布局,并且需要根据您的需要进行调整。但我希望它能让您了解需要做什么:

UIView* view = viewController.view;
view.frame = self.view.window.bounds;
[UIView transitionWithView:self.view.window
                  duration:0.2 
                   options:UIViewAnimationOptionTransitionCurlUp 
                animations:^(void) {
                    [self.view.window addSubview:view];
                } 
                completion:^(BOOL finished) {
                    [viewController.view removeFromSuperview];
                    [viewController presentModalViewController:viewController
                                                      animated:NO];
                }];

No there is no full page curl variant for UIModalTransitionStyle.

If this is what you need then you must implement it manually yourself. It is more complex that doing a simple modal view controller but doable.

This code snipped only works in default portrait layout, and will need tweaking for your needs. But I hope it gives you an idea of what you need to do:

UIView* view = viewController.view;
view.frame = self.view.window.bounds;
[UIView transitionWithView:self.view.window
                  duration:0.2 
                   options:UIViewAnimationOptionTransitionCurlUp 
                animations:^(void) {
                    [self.view.window addSubview:view];
                } 
                completion:^(BOOL finished) {
                    [viewController.view removeFromSuperview];
                    [viewController presentModalViewController:viewController
                                                      animated:NO];
                }];
怂人 2024-11-26 04:23:12

PeyloW 和 xs2bush 的出色建议肯定会让您卷曲整页。我怀疑你想要的是超过部分且少于整页的卷曲。我不认为有一个 API 可以做到这一点,但是有一个可能有效的技巧怎么样?

使用 PeyloW 或 xs2bush 的方法,但还要启动一个持续时间略小于 UIViewAnimationOptionTransitionCurlUp 动画持续时间的计时器。

当计时器到期时,冻结动画并将其从卷曲的 UIView 中删除:

curledView.frame = [[curledView.layer presentationLayer] frame];
[curledView.layer removeAllAnimations];

希望这会给您带来所需的效果。

PeyloW's and xs2bush's excellent suggestions will certainly give you a full page curl. I suspect that you're after a more-than-partial-and-less-than-full page curl though. I don't think there's an API for this, but how about a trick that might just work?

Use either PeyloW's or xs2bush's method, but also launch a timer with a duration slightly less than the UIViewAnimationOptionTransitionCurlUp animation duration.

When the timer expires, freeze the animation and remove it from the UIView that is curling up:

curledView.frame = [[curledView.layer presentationLayer] frame];
[curledView.layer removeAllAnimations];

Hopefully, this will get you the desired effect.

神魇的王 2024-11-26 04:23:12

我会使用 PeyloW 的答案,但还有另一种方法。将 UIView 添加到要呈现的模态视图(在 viewDidLoad 中),并将其放置在左上角,并为其指定背景颜色 [UIColor clearColor]。这样,视图将不会在屏幕上看到,但卷曲过渡将被迫从屏幕上剥离以“显示”左上角视图。

I'd use PeyloW's answer, but there is another way. Add a UIView to the modal view you are going to present (in viewDidLoad), and position it in the top left hand corner, and give it a backgroundColor of [UIColor clearColor]. That way the view will not be seen on screen, but the page curl transition will be forced to peel off the screen to 'show' the top-left hand corner view.

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