小编Ant*_*ony的帖子

如何在没有任何透明度/淡入淡出效果的情况下执行kCATransitionPush动画

可能重复:
iPhone CATransition为任何动画的开始和结束添加淡入淡出?

我正在尝试复制[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)

iphone core-animation objective-c uiviewcontroller uinavigationcontroller

7
推荐指数
1
解决办法
4173
查看次数

如何计算大圆路径上的当前位置

给定起点(origLat,origLon),终点(destLat,destlon)和完成的行程百分比.如何计算当前位置(curLat,curLon)?

math geometry objective-c geolocation

3
推荐指数
1
解决办法
1011
查看次数