【发布时间】:2016-02-22 23:33:45
【问题描述】:
我为UINavigationController 过渡添加了一个动画,其中涉及重新定位UIImageView:
transitionCoordinator()?.animateAlongsideTransition({ context in
UIView.performWithoutAnimation {
// ...
}
// ...
myImageView.frame = newFrame
}, completion: {
// ...
})
此代码位于viewWillAppear(_:) 中。到目前为止,此代码运行良好。但是,我不仅想更改图像视图的框架,还想使用交叉溶解来更改图像。我试过这个:
transitionCoordinator()?.animateAlongsideTransition({ context in
UIView.performWithoutAnimation {
// ...
}
// ...
myImageView.frame = newFrame
UIView.transitionWithView(boardImageView,
duration: context.transitionDuration(),
options: .TransitionCrossDissolve,
animations: {
myImageView.image = newImage
}, completion: nil)
}, completion: {
// ...
})
但这不起作用 - 它只是在动画完成后更改图像视图的图像(没有交叉溶解)。有没有办法在过渡期间进行交叉溶解?
【问题讨论】:
标签: ios uiview uinavigationcontroller uiviewanimation