UIView transitionFromView: how can I do black background during transition?

前提是你 提交于 2019-12-12 19:28:09

问题


I use next code.

[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:


回答1:


Try with setting the black background color for parent view of animated view.

viewB.superview.backgroundColor = [UIColor blackColor];


来源:https://stackoverflow.com/questions/6493478/uiview-transitionfromview-how-can-i-do-black-background-during-transition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!