本文介绍了UIView transitionFromView:如何在过渡期间做黑色背景?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用下一个代码.
[UIView transitionFromView:viewA toView:viewB duration:1.0 options: UIViewAnimationOptionTransitionFlipFromLeft
completion: ^(BOOL inFinished) {
viewB.hidden = NO;
viewA.hidden = YES;
//do any post animation actions here
}];
转换正常.我想在过渡期间设置黑色背景.我怎样才能做到这一点?请看照片:
Transition works OK. I want to set a black background during transition. How can I do this?Please, see the photo:
推荐答案
尝试为动画视图的父视图设置黑色背景颜色.
Try with setting the black background color for parent view of animated view.
viewB.superview.backgroundColor = [UIColor blackColor];
这篇关于UIView transitionFromView:如何在过渡期间做黑色背景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!