在iPhone应用程序风景模式页面卷曲问题 [英] Landscape-mode page curl issue in iPhone app

查看:526
本文介绍了在iPhone应用程序风景模式页面卷曲问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序,我有一个页面卷曲效果。页面卷曲效果正常工作在纵向模式,而在横向模式下页面卷曲的结局发生在我垫的角落。

In my app, I have a page curl effect. The page curl effect works correctly in portrait mode whereas in landscape mode the page curl ending takes place at the corner of the i pad.

在横向模式我希望页面中间,如下图中走散了。

In landscape mode I want the page to be get separated in the middle as in the following figure.

但我的页面卷曲效果看起来如下图所示:

But my page curl effects looks as the following figure.

我用下面的code:

-(void)PresentView
{
    [UIView animateWithDuration:1.0  animations:^
    {
                         CATransition *animation = [CATransition animation];

                         [animation setDelegate:self];
                         [animation setDuration:0.7];

                         [animation setTimingFunction:UIViewAnimationCurveEaseInOut];

                         animation.type = @"pageCurl";

                         animation.fillMode = kCAFillModeForwards;
                         animation.endProgress = 0.65;

                         [animation setRemovedOnCompletion:NO];
                         [m_container.layer addAnimation:animation forKey:@"pageCurlAnimation"];  

                         [m_container addSubview:self];
                         ;}  

     ];    
}

我如何在横向模式下的页面卷曲动画作为第一个数字?

How do I get the page curl animation in landscape mode as in the first figure?

推荐答案

您需要调整的两个属性 UIPageViewController

You need to adjust two properties of UIPageViewController:


  • 设置 doubleSided ,让每一页都有其两侧的内容

  • 设置 spineLocation UIPageViewControllerSpineLocationMid ,让你有两页加入在视中间

  • Set doubleSided to YES, so that each page has content on both of its sides
  • Set spineLocation to UIPageViewControllerSpineLocationMid so that you have two pages joined in the middle of view

这篇关于在iPhone应用程序风景模式页面卷曲问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆