【发布时间】:2012-04-09 06:38:34
【问题描述】:
我目前有一个 monotouch 项目,它使用 Storyboard 和一些无 xib(在 Storyboard 中没有相应 xib 或引用的 ViewController)控制器(例如 Monotouch.Dialog)的组合。
从 Storyboard ViewControllers 调用到 xib-less 的一切都很好。我遇到的问题是,当我需要从无 xib 的 ViewController 调用回 Storyboard ViewController 时。
示例流程:
- 故事板
- TabViewController
- FirstViewController DialogViewController(不在 Storyboard/xib-less 中)
- 另一个视图控制器
- FirstViewController DialogViewController(不在 Storyboard/xib-less 中)
- TabViewController
问题是在加载另一个视图控制器时,例如。
var avc = new AnotherViewController();
avc.Person = person
_dvc.ActivateController(avc);
我不得不在 AnotherViewController 上创建一个空的构造函数来实现这一点。然后加载这个视图,但它只是一个空的 UIViewController(不是我的故事板中的那个)。我无法在 MT.Dialog 与 Interface Builder 中的 AnotherViewController 之间设置 Segue,因为 DialogViewController 是通过编程方式创建的。
解决方法 atm 是完全忘记 Storyboard 中的 AnotherViewController 并仅以编程方式创建它 - 但我无法将 Storyboard 视图与编程视图结合/混合,这真是太遗憾了。
任何提示(或 monotouch C# sn-ps)将不胜感激!
【问题讨论】:
-
不确定我的理解是否正确:你想从一个编程设计的视图控制器中弹出你的
AnotherViewController- 它是在你的故事板中使用 IB 设计的 - 对吧?
标签: ios xamarin.ios storyboard xib