题
我试图做出来的图的手动实例化和我得到的是一个黑色的屏幕。
下面是我FinishedLoading的核心
currentController = new ChoicesScreen(this.window.Handle);
window.AddSubview (currentController.View);
window.MakeKeyAndVisible();
请注意:CurrentController是protected UIViewController currentController
ChoicesScreen在IB所定义,具有适当的网点,动作等换言之其有效的视图。
我试过ChoicesScreen默认的构造函数,得到了同样的事情。很显然,我失踪如何让我的自己的屏幕了一些东西。
解决方案
德里斯,
您需要设置新视图的帧,以限定其将在视图显示:
currentController = new ChoicesScreen(this.window.Handle);
currentController.View.Frame = new System.Drawing.RectangleF(0, 0, 320, 480);
window.AddSubview (currentController.View);
window.MakeKeyAndVisible();
不隶属于 StackOverflow