Ant*_*ony 7 iphone core-animation objective-c uiviewcontroller uinavigationcontroller
我正在尝试复制[UIViewController presentModalViewController:animated:]执行的"从底部向上滑动"动画,但不调用它,因为我不想要模态视图.
下面的核心动画代码非常接近但似乎在改变视图的透明度值.在动画开始时,您可以部分地透过视图向上滑动.在动画的中间/结尾,我们滑过的视图是完全透明的,所以我们可以看到它背后.在这个动画中,我希望两者都保持完全不透明.
有关如何停止透明度的任何想法在此代码中更改或以其他方式获得我正在寻找的"向上滑动动画"而无需模态视图?
UIViewController *nextViewController = [[UIViewController alloc] autorelease];
nextViewController.view.backgroundColor = [UIColor redColor];
CATransition *animation = [CATransition animation];
animation.duration = 3.5;
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
animation.type = kCATransitionPush;
animation.subtype = kCATransitionFromTop;
[self.navigationController pushViewController:nextViewController animated:NO];
[self.navigationController.view.layer addAnimation:animation forKey:nil];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4173 次 |
| 最近记录: |