我有 View1 和 View2。在 View1 中,我调用以下命令来访问 View2:
View2 pl = new View2();
this.NavigationController.PushViewController(pl, true);
View2 加载正常。然后在 View2 中,我调用代码返回到 View1:
this.NavigationController.PopViewControllerAnimated(true);
我如何在 View1 中检测到它现在再次成为事件 View ?我似乎没有什么明显可以覆盖的。我将采用 MonoTouch 或 XCode 范式中的答案。
最佳答案
我假设在您的代码中 View1 和 View2 是 UIViewController 的子类,现在是 UIView,对吗?
如果是这样,您可以覆盖 V1 上的 ViewWillAppear,它会在 View2 的动画消失开始之前被调用:
public override void ViewWillAppear(bool animated) {}
关于c# - 如何检测控件何时移动到 MonoTouch 中的 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12451416/