2016-05-13 41 views
0

我有一个有很多屏幕的应用程序,比如说HomePage,Section Screen和Detail Page,Category Screen。如何在Xamarin.iOS中使用SideBarController时导航到新屏幕

我使用NavigationController从主页导航到截面屏幕。

在SectionScreen中,我使用了SideBarController组件(https://components.xamarin.com/view/sidebarnavigation)来实现导航抽屉或弹出菜单。

问题是如何从Section Screen导航到Detail Page或导航到Category Screen。我需要从MenuControllerContentController进行此类导航。我不想只改变contentView。我想推另一个UIViewController

我已经使用了常用的一个:

this.NavigationController.PushViewController(new UIViewControllerExample(), true); 

,但也存在一些问题:

  • 在明细页面无法访问NavigationBar
  • 当我按下back,该应用程序崩溃的错误:

    不能将自己添加到子视图

这是它应该如何看起来像。 enter image description here

这就是问题所在。第一个图像显示当我使用上面的代码发生什么,

enter image description here

enter image description here

不知道如何解决这个问题。

回答

0

,你可以在组件的那页你应该使用SidebarController为找到你navigationcontroller

SidebarController.ChangeContentView(new OtherContentController()); 
+0

嗯,我知道这一点,但正如我上面说我不想改变内容查看,我需要导航在新的屏幕上。 – Xhulio

相关问题