我正在尝试手动实例化视图,但得到的只是黑屏。
这是我的 FinishedLoading 的核心
currentController = new ChoicesScreen(this.window.Handle);
window.AddSubview (currentController.View);
window.MakeKeyAndVisible();
注意:CurrentController 是一个protected UIViewController currentController
ChoicesScreen 在 IB 中定义,具有适当的出口、操作等。换句话说,它是一个有效的视图。
我尝试了 ChoicesScreen 的默认构造函数并得到了同样的结果。显然,我在如何启动自己的屏幕方面遗漏了一些东西。