在 iPhone 上的 3 个视图控制器之间切换
我有 3 个视图控制器。首先显示主视图(controller1 的视图)。根据按钮选择,将显示第二个视图(控制器 2 的视图)。此视图上有几个按钮和一个主页按钮。选择这些将显示带有动画的第三个视图(controller3 的视图)。选择主页按钮将显示主视图(controller1 的视图)。我遇到的问题是,当我按下控制器 2 的视图上的按钮来显示控制器 3 的视图时,在动画期间我在后台看到控制器 1 的视图。我怎样才能摆脱它?
I have 3 view controllers. Main view (controller1's view) is displayed first. Based on button selection the 2nd view (controller2's view) is displayed. There are several buttons and a home button on this view. Selecting those will display 3rd view (controller3's view) with animation.Selecting home button will display the main view(controller1' view). The issue I have is when I press buttons on controller2's view to display controller3's view, during animation I see the controller1's view in the background. How can I get rid of that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来您可能想使用presentModalViewController。这可能无法解决 view1 在动画期间可见的其他问题。我尝试设置用于 view1 的
hidden
属性。Sounds like you might want to use
presentModalViewController
. That probably wont fix your other problem with view1 being visible during the animation. I'd try and set thehidden
property to use for view1.您可以在动画序列之前从超级视图中删除controller1的视图。您应该将其作为从控制器 1 到控制器 2 转换的一部分。
当然,您需要在某个时候将其添加回来。
You could remove controller1's view from the superview before the animation sequence. You should be doing this as part of the transition from controller1 to controller2.
Of course, you will need to add it back in at some point.