Monotouch:UINavigationController,设置RootViewController
如何在 Monotouch 中映射 initWithRootViewController Objective-C 方法?
从 Miguel de Icaza Rosetta 网站上,我找到了以下翻译,但我不知道如何应用它:
Selector: initWithRootViewController:
Method: IntPtr Constructor (UIViewController rootViewController);
然后,我还有另一个问题需要解决。我会在运行时更改 UINavigationController RootViewController。是否可以?网上冲浪,我发现了这个 更改 UINavigationController 的根视图控制器。有更简单的解决方案吗?
先感谢您。
编辑:我的目标是在 Monotouch 中映射 initWithRootViewController 方法(在链接中提供)。
How is it possible to map the initWithRootViewController objective-c method in Monotouch?
From Miguel de Icaza Rosetta site, I've found the following translation but I don't know how to apply it:
Selector: initWithRootViewController:
Method: IntPtr Constructor (UIViewController rootViewController);
Then, I also have another problem to solve. I would change the UINavigationController RootViewController during runtime. Is it possible? Surfing the Web, I've found this Changing a UINavigationController’s Root View Controller. Is there a more simple solution?
Thank you in advance.
Edit: my goal is to map the initWithRootViewController method (provided in the link) in Monotouch.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要回答您的第一个问题 - 您只需创建一个新的
UINavigationController
如下:从技术上讲,可以通过修改
ViewControllers
属性来更改根控制器。例如:编辑
尝试将以下构造函数添加到您的自定义
UINavigationController
:我不确定这是否是完成它的最佳方法,但它会起作用。
To answer your first question - you simply create a new
UINavigationController
as below:Technically it would be possible to change the root controller by modifying the
ViewControllers
property. For example:EDIT
Try adding the following constructor to your custom
UINavigationController
:I'm not sure if this is the best way to get it done, but it'll work.