Iphone 我想翻转我的应用程序';s启动屏幕-如何模拟翻页动画,如打开一本书的封面?
我有一个Iphone应用程序,我想在splashview中实现flipanimation,正如在路径应用程序中所做的那样。我正在使用一个单独的viewcontroller来显示我的splashview。我想用此动画将其从窗口中删除。有人知道如何实现这一点吗?这就是我添加视图的步骤。我如何从窗口中删除此视图,并使用类似动画的动画添加新视图`Iphone 我想翻转我的应用程序';s启动屏幕-如何模拟翻页动画,如打开一本书的封面?,iphone,ios,ipad,Iphone,Ios,Ipad,我有一个Iphone应用程序,我想在splashview中实现flipanimation,正如在路径应用程序中所做的那样。我正在使用一个单独的viewcontroller来显示我的splashview。我想用此动画将其从窗口中删除。有人知道如何实现这一点吗?这就是我添加视图的步骤。我如何从窗口中删除此视图,并使用类似动画的动画添加新视图` - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.startupController = [[StartupViewController alloc] initWithNibName:@"StartupViewController" bundle:nil];
[window addSubview:self.startupController.view];
[self.startupController.activityIndicator setHidden:NO];
[self.startupController.activityIndicator startAnimating];
[window makeKeyAndVisible];
timer = [NSTimer scheduledTimerWithTimeInterval: 2.0
target: self
selector: @selector(handleTimer:)
userInfo: nil
repeats: NO];
// [window addSubview:navigationController.view];
// [window makeKeyAndVisible];
return YES;
}
-(void)handleTimer:(NSTimer*)timer {
[self.startupController.activityIndicator stopAnimating];
[self.startupController.activityIndicator setHidden:YES];
self.startupController.view.layer.anchorPoint=CGPointMake(0, .5);
self.startupController.view.center = CGPointMake(self.startupController.view.center.x - self.startupController.view.bounds.size.width/2.0f, self.startupController.view.center.y);
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:5];
[UIView setAnimationDelay:1];
self.startupController.view.transform = CGAffineTransformMakeTranslation(0,0);
CATransform3D _3Dt = CATransform3DIdentity;
_3Dt =CATransform3DMakeRotation(3.141f/2.0f,0.0f,-1.0f,0.0f);
_3Dt.m34 = 0.001f;
_3Dt.m14 = -0.0015f;
self.startupController.view.layer.transform =_3Dt;
[UIView commitAnimations];
//[window addSubview:navigationController.view];
//[window makeKeyAndVisible];
}
`when i am doing like this i can have that flip animation.but when the view is flipping i need to have my home view there.But when i am uncomenting the last two lines that functionality is working but there is no animation.Can anybody help me?
我喜欢在工作中使用的方法。虽然在那里使用的动画正在褪色,但它是动画的良好容器 如果还设置了animationTransition,则应该能够获得所需的动画。像这样的
[UIView设置动画转换:UIViewAnimationTransitionUrlUp for视图:splashView缓存:是]代码>
这至少可以让您开始。:-) 这里有一个代码,我已经在我的一个项目中使用过了
在那里,我有一个像一个垫子一样打开封面页的要求
#pragma mark Open Book Animation
- (void)pageOpenView:(UIView *)viewToOpen duration:(NSTimeInterval)duration {
// first add next view below current view
[self.view.window insertSubview:navigationController.view
belowSubview:self.view];
// set anchor point for the view animation
viewToOpen.layer.anchorPoint = CGPointMake(0.0f, 0.0f);
viewToOpen.center = CGPointMake(0,
(viewToOpen.center.y -
(viewToOpen.bounds.size.height/2.0f)));
// start the Page Open
[UIView beginAnimations:@"Page Open" context:nil];
[UIView setAnimationDuration:2.0];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(didEndAnimation)];
[viewToOpen.layer setValue:[NSNumber numberWithInt:180]
forKeyPath:@"transform.rotation.x"];
[splashImageView setHidden:YES];
[UIView commitAnimations];
}
这里viewToOpen是需要动画的UIView,duration是动画的时间线
希望这是你所需要的
享受编码:)