Swift 动画长边过渡是如何工作的?
这是我的Swift 动画长边过渡是如何工作的?,swift,ios8,uiviewanimationtransition,Swift,Ios8,Uiviewanimationtransition,这是我的UIPresentationController子类的一部分: override func presentationTransitionWillBegin() { if let containerView = containerView { dimmingView.frame = containerView.bounds dimmingView.backgroundColor = UIColor.yellowColor() con
UIPresentationController
子类的一部分:
override func presentationTransitionWillBegin() {
if let containerView = containerView {
dimmingView.frame = containerView.bounds
dimmingView.backgroundColor = UIColor.yellowColor()
containerView.insertSubview(dimmingView, atIndex: 0)
presentedViewController.transitionCoordinator()?.animateAlongsideTransition({ context in
self.dimmingView.backgroundColor = UIColor.greenColor() //line A
}, completion: nil)
}
}
问题是,我甚至一毫秒都看不到黄色。为什么?过渡期旁边的是什么意思?什么过渡期?我的转换持续时间设置为UIViewControllerAnimatedTransitioning
至5秒
如果我删除我的行A,那么我只能看到黄色,这是正常的。为什么此动画(从黄色到绿色)不占用我的5秒钟?您找到了解决方案吗?我也有同样的问题,我还没有发现。