【发布时间】:2013-09-22 14:48:47
【问题描述】:
我有两个视图控制器,分别称为“ViewControllerA”和“ViewControllerB”。当应用程序加载时,会显示 ViewControllerA。在 ViewControllerA 的 touchesEnded:withEvent: 中,它调用 ViewControllerB 上的 presentViewController:。 ViewControllerB 的加载工作正常;唯一的问题是当它们转换时, ViewControllerA 变黑。即使在转换到 ViewControllerB 时,如何让 ViewControllerA 继续查看其内容?如果相关,我会使用自定义转换,此处演示:
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.7f];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationRepeatCount:1.0f];
[UIView setAnimationRepeatAutoreverses:NO];
[UIView setAnimationDelegate:self];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
toViewController.view.frame = self.view.bounds;
[self presentViewController:toViewController animated:NO completion:nil];
[UIView commitAnimations];
【问题讨论】:
-
这个动画应该做什么? toViewController.view 的边界是什么?
-
@rdelmar - 最初,边界覆盖地图上的一个小图块,例如屏幕上的一个红点 in this image,当点击该图块时,边界会扩大以填充屏幕。它旨在给用户一种放大红点(代表城市)的感觉。动画效果很好;只是当动画开始时,我正在转换的视图变黑了。
标签: ios objective-c uiviewcontroller transition ios7