1

我正在尝试使用 PresentModalViewController 通过 XIB 呈现 UInavigationController。我的 XIB 的结构如下:

UINavigationController
 -UIView

第一响应者连接到 UIView。并且 UIVIew 被放入 UINavigationController

现在每次模态显示时只有视图是可见的,并且 NavigationController 始终为空。

如果我以编程方式初始化 UINavigationController 并且在我的 xib 中只有一个 UIVIew ,它可以正常工作,如下所示:

var registerView = new RegisterView();
UINavigationController navController = new UINavigationController(registerView);
registerView.Title="Register";
this.PresentModalViewController(navController,true);

它表明我在我的 XIB 中错误地连接 UINavigationController,是否有任何我应该连接的插座等?

此外,问题与 PresentModalViewController 的模态显示无关,因为我曾尝试使用 AppDelegate 中的 xib,如下所示:

viewController = new RegisterView();
window.RootViewController = viewController;
window.MakeKeyAndVisible ();
4

1 回答 1

0

在 appdelegate 中尝试这样的事情:

        window = new UIWindow (UIScreen.MainScreen.Bounds);
        navcontroller = new UINavigationController ();
        navcontroller.PushViewController (new RegisterView(), false);
        window.RootViewController = navcontroller;
        window.MakeKeyAndVisible ();

        return true;

需要添加导航的是rootviewcontroller,homeview推送到view上

于 2012-05-24T09:40:47.590 回答