【问题标题】:Landscape-mode page curl issue in iPhone appiPhone应用程序中的横向模式页面卷曲问题
【发布时间】:2012-01-11 04:51:47
【问题描述】:

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

在横向模式下,我希望页面在中间分开,如下图。

但是我的翻页效果如下图

我正在使用以下代码:

-(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];
                         ;}  

     ];    
}

如何在横向模式下获得第一张图的页面卷曲动画?

【问题讨论】:

标签: iphone animation landscape page-curl


【解决方案1】:

需要调整UIPageViewController的两个属性:

  • doubleSided设置为YES,这样每个页面的两边都有内容
  • spineLocation 设置为UIPageViewControllerSpineLocationMid,这样您就可以在视图中间连接两个页面

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-04-21
    • 1970-01-01
    • 1970-01-01
    • 2011-10-08
    • 1970-01-01
    • 2010-09-05
    • 2014-03-12
    • 1970-01-01
    相关资源
    最近更新 更多