Iphone 旋度对景观模式的影响
我试图通过使用下面的代码片段来实现curl效果 蜷缩Iphone 旋度对景观模式的影响,iphone,ios,ipad,Iphone,Ios,Ipad,我试图通过使用下面的代码片段来实现curl效果 蜷缩 [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.95]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES]; [UIView setAnimationDidStopSelector:@selector(an
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.95];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown
forView:self.view cache:YES];
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
[UIView setAnimationDelegate:self];
蜷缩
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.95];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
[UIView setAnimationDelegate:self];
但这在肖像模式下效果很好
我想在横向模式下实现它,在右上角和左下角进行录音
目前它的作用是相反的
非常感谢#导入
#import <QuartzCore/QuartzCore.h>
-(void)pageCurltoNextorPrevious:(UIView*)view:(int)identifier {
// Curl the image up or down
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:1.0];
CAMediaTimingFunction *fun=[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
[animation setTimingFunction:fun];
if (identifier==1){
//next animation
animation.type = @"pageCurl";
animation.subtype=@"fromRight";
animation.fillMode = kCAFillModeForwards;
animation.endProgress = 1.0; //0.58;
}
else {
//previous animation
animation.type = @"pageCurl";
animation.subtype=@"fromLeft";
animation.fillMode = kCAFillModeBackwards;
animation.startProgress = 0.0;
}
[animation setRemovedOnCompletion:NO];
//[view exchangeSubviewAtIndex:0 withSubviewAtIndex:2];
[[view layer] addAnimation:animation forKey:@"pageCurlAnimation"];
}
-(void)pageCurltoNextorPrevious:(UIView*)视图:(int)标识符{
//向上或向下卷曲图像
CATTransition*动画=[CATTransition动画];
[动画设置代理:self];
[动画设置持续时间:1.0];
CAMediaTimingFunction*fun=[CamediaTimingFunctionWithName:kCAMediaTimingFunctionEaseInEaseOut];
[动画设置计时功能:乐趣];
如果(标识符==1){
//下一个动画
animation.type=@“pageCurl”;
animation.subtype=@“fromRight”;
animation.fillMode=kCAFillModeForwards;
animation.endProgress=1.0;//0.58;
}
否则{
//以前的动画
animation.type=@“pageCurl”;
animation.subtype=@“fromlight”;
animation.fillMode=kCAFillModeBackwards;
animation.startProgress=0.0;
}
[动画集移除完成:否];
//[视图交换子视图索引:0与子视图索引:2];
[[view layer]addAnimation:animation forKey:@“pageCurlAnimation”];
}
#导入
-(void)pageCurltoNextorPrevious:(UIView*)视图:(int)标识符{
//向上或向下卷曲图像
CATTransition*动画=[CATTransition动画];
[动画设置代理:self];
[动画设置持续时间:1.0];
CAMediaTimingFunction*fun=[CamediaTimingFunctionWithName:kCAMediaTimingFunctionEaseInEaseOut];
[动画设置计时功能:乐趣];
如果(标识符==1){
//下一个动画
animation.type=@“pageCurl”;
animation.subtype=@“fromRight”;
animation.fillMode=kCAFillModeForwards;
animation.endProgress=1.0;//0.58;
}
否则{
//以前的动画
animation.type=@“pageCurl”;
animation.subtype=@“fromlight”;
animation.fillMode=kCAFillModeBackwards;
animation.startProgress=0.0;
}
[动画集移除完成:否];
//[视图交换子视图索引:0与子视图索引:2];
[[view layer]addAnimation:animation forKey:@“pageCurlAnimation”];
}
请尝试这种方式。我在视图导航中使用了一个视图
第一个视图下一个信息视图我创建了卷曲效果:
InfoView *objdb=[[InfoView alloc] initWithNibName:@"InfoView" bundle:nil];
[UIView beginAnimations:nil context:NULL ];
[UIView setAnimationCurve:UIViewAnimationTransitionCurlUp];
[UIView setAnimationDuration:1.0];
[self presentModalViewController:objdb animated:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
[objdb release];
然后从infoview返回主视图,然后使用此(向下卷曲效果):
我希望这对你有帮助。请尝试这种方式。我在视图导航中使用了一个视图 第一个视图下一个信息视图我创建了卷曲效果:
InfoView *objdb=[[InfoView alloc] initWithNibName:@"InfoView" bundle:nil];
[UIView beginAnimations:nil context:NULL ];
[UIView setAnimationCurve:UIViewAnimationTransitionCurlUp];
[UIView setAnimationDuration:1.0];
[self presentModalViewController:objdb animated:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
[objdb release];
然后从infoview返回主视图,然后使用此(向下卷曲效果):
我希望这对你有帮助。哦,亲爱的。。。您似乎已将代码格式化为引号。您所说的“在右上角和左下角录制”是什么意思?当你说它是反向工作的:反向到什么?目前,卷曲是从右上角下来的,相反,我需要它从右下角下来,反之亦然。使用我发布的功能,它将独立于方向,它将自动调整。亲爱的。。。您似乎已将代码格式化为引号。您所说的“在右上角和左下角录制”是什么意思?当你说它是反向工作的:反向到什么?目前,卷曲是从右上角向下,相反,我需要从右下角向下,反之亦然。使用我发布的功能,它将独立于方向,它将自动调整