本文介绍了需要有关transitionFromView:toView:duration:options:completion的帮助:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于 transitionFromView:toView:duration:选项:完成:苹果文档在最后几行中说了这一点:

Regarding transitionFromView:toView:duration:options:completion: Apple doc says this in last few lines:

如果ViewController具有2个全屏尺寸的视图,一次只能显示一个,则没有问题:

If a ViewController has 2 full screen size views display one at a time then no issues:

[transitionFromView:self.view到View:self.view2 ...

[transitionFromView:self.view toView:self.view2...

但这意味着您有责任适当更新视图控制器以处理更改吗??

如果我这样做:

secondViewController *sVc = [[secondViewController alloc]init];
[transitionFromView:self.view toView:sVc.view...

我如何适当地更新视图控制器以处理更改的职责?或如何更新ViewController?

how its my responsibility to update the view controller appropriately to handle the change? or how to update ViewController?

更新

我创建了一个单视图项目,添加了secondVC,然后在firstVC上单击按钮,我这样做了:

I created a single view projec, add secondVC then in firstVC on button tap i did this:

self.svc = [[secondVC alloc]init]; 

[UIView transitionFromView:self.view toView:self.svc.view duration:1.0 options:UIViewAnimationOptionTransitionFlipFromLeft completion:^(BOOL finished) {}];

... secondVC viewDidLoad正在工作,其nslog正在工作.

... secondVC viewDidLoad is working its nslog is working.

然后如何处理viewcontroller的更新?

Then how to handle updating of viewcontroller?

推荐答案

语句您有责任适当地更新视图控制器以处理更改."这意味着您必须适当地调用视图层次结构委托方法,例如:

The statement "it is your responsibility to update the view controller appropriately to handle the change." it meant that you have to appropriately call view hierarchy delegate methods such as:

- (void)viewDidLoad;
- (void)viewDidUnload;
- (void)viewWillAppear;
- (void)viewDidDisappear;

以及负责适当视图管理的其他方法.

And other methods that are responsible for proper view management.

以下是一些 .

这篇关于需要有关transitionFromView:toView:duration:options:completion的帮助:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 01:06