iphone - 在指定的 UIView 中应用动画?

标签 iphone objective-c ios

我想制作一个像“开始 iPhone 开发”中的 SwichView 示例那样的动画。我的动画代码:

    [UIView beginAnimations:@"View Flip" context:nil];
    [UIView setAnimationDuration:1.25];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];

    [UIView setAnimationTransition:
    UIViewAnimationTransitionFlipFromRight
                           forView:self.view cache:YES];

    [blueViewController viewWillAppear:YES];
    [yellowViewController viewWillDisappear:YES];
    [blueViewController.view removeFromSuperview];
    [self.view insertSubview:yellowViewController.view atIndex:0];
    [yellowViewController viewDidDisappear:YES];
    [blueViewController viewDidAppear:YES];

    [UIView commitAnimations];

alt text

但我不希望我的工具栏与另一个 View “翻转”。我不希望它执行任何动画。我可以吗?

这是 SwitchView 示例:

http://www.mediafire.com/?lirh0ydcy6c2f9d

最佳答案

在您的 View 中尝试此操作,或获取弹出动画

- (void)doPopInAnimationWithDelegate
{ 
CALayer *viewLayer = appDelegate.objSplitView.view.layer;
CAKeyframeAnimation* popInAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; 
popInAnimation.duration = 0.5; 
popInAnimation.values = [NSArray arrayWithObjects: [NSNumber numberWithFloat:0.6], [NSNumber numberWithFloat:1.1], [NSNumber numberWithFloat:.9], [NSNumber numberWithFloat:1], nil]; 
popInAnimation.keyTimes = [NSArray arrayWithObjects: [NSNumber numberWithFloat:0.0], [NSNumber numberWithFloat:0.4], [NSNumber numberWithFloat:0.8], [NSNumber numberWithFloat:1.0], nil]; 
[viewLayer addAnimation:popInAnimation forKey:@"transform.scale"]; 
}

关于iphone - 在指定的 UIView 中应用动画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3903294/

相关文章:

iphone - 你知道iOS应用程序商店中有哪些通过MGWT+phonegap完成的应用程序吗?

ios - 试图在 uiscrollview 内部绘制

ios - 如何在 Swift 中保存从 UIImagePickerController 中选取的图像?

ios - Xcode 错误 : Could not launch app - unable to attach

html - 元视口(viewport)标签似乎被完全忽略或没有效果

iphone - 如何使用 Xcode 制作首次启动 iPhone App 的导览

iphone - NSUserDefaults 返回的共享默认对象的数据类型

iphone - 在启动图像上隐藏状态栏

ios - 建筑的 undefined symbol ..在动态框架中

ios - 如何在 iOS 中获取没有当前位置(lat-long)的城市名称?