iPhone 应用程序中的横向模式页面卷曲问题
在我的应用程序中,我有卷页效果。卷页效果在纵向模式下正常工作,而在横向模式下,卷页结束发生在 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];
;}
];
}
如何获取页面横向模式下的卷曲动画如第一张图所示?
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.
I am using the following 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
需要调整
UIPageViewController
的两个属性:doubleSided
设置为YES
,这样每个页面的两面都有内容spinLocation
到UIPageViewControllerSpineLocationMid
以便您在视图中间加入两个页面You need to adjust two properties of
UIPageViewController
:doubleSided
toYES
, so that each page has content on both of its sidesspineLocation
toUIPageViewControllerSpineLocationMid
so that you have two pages joined in the middle of view