ios - this.NavigationController 为空(xamarin ios stoaryboard)

标签 ios iphone xamarin xamarin.ios

当我通过单击登录按钮从一个 Storyboard移动到另一个 Storyboard时,this.NavigationController 显示为空。所以我无法 PushViewController。

我有一个带有两个 View 的 Storyboard,并且这两个 View 有单独的 UIViewController。

enter image description here

最佳答案

您必须显式创建一个 UINavigationController 并将您的初始 View Controller 放入其中。这样做会自动设置该导航 Controller 中包含的任何 View Controller 的 NavigationController 属性。

// create the view controller for your initial view - using storyboard, code, etc
var first = new UIViewController(...); 

// wrap your VC inside a Nav controller
var nav = new UINavigationController(first);

关于ios - this.NavigationController 为空(xamarin ios stoaryboard),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32120292/

相关文章:

ios - 有没有办法在 Swift 中将特殊字符转换为普通字符?

objective-c - NSScanner - 性能缓慢 - (UITableView, NSXMLParser)

ios - 在 UIView 中的 UISegmentedControl 中切换 View

xaml - Xamarin.Forms 中 MasterDetailPage 的 XAML 中的数据绑定(bind)

ios - 项目无法在 iPhone 上运行,而在模拟器上运行良好

objective-c - 单击时展开 UITextView?

ios - 在设备 : "Could not allocate a resource" 上运行时出现 Xcode 错误

javascript - 如何在邮件签名中使用位智导航链接

android - 如何在 Xamarin.Forms 中获取 iOS 和 Android 的辅助功能字体大小,以便我可以在 HTML WebView 中更改字体大小?

ios - 这个 Objective-C 语句是什么意思?