简体   繁体   English

从Xamarin.iOS绑定库引用故事板

[英]Referencing Storyboard from Xamarin.iOS Binding Library

In my Xamarin project i need to reference native iOS Framework through Binding Library. 在我的Xamarin项目中,我需要通过绑定库引用本机iOS框架。 Besides native code, this framework provides few storyboards. 除了本机代码,此框架还提供了一些故事板。 How can i reference them in my app? 如何在我的应用程序中引用它们?

Calling standard UIStoryboard.FromName results in not found exception. 调用标准UIStoryboard.FromName导致找不到异常。

var storyboard = UIStoryboard.FromName("FromFramework", null);

Passing null as a Bundle parameter means that i search storyboard in main application bundle which obviously ends with exception "Could not find a storyboard" but I'm unable to find framework bundle. 传递null作为Bundle参数意味着我在主应用程序捆绑包中搜索情节提要,该情节提要显然以异常“找不到情节提要”结尾,但是我找不到框架包。

var bundle = NSBundle.FromClass(
     new ObjCRuntime.Class(typeof(FromFrameworkViewController)))

When i try to find correct bundle using FromClass and passing class from framework it still returns me main bundle. 当我尝试使用FromClass查找正确的包并从框架传递类时,它仍然返回主包。 Creating Bundle from framework identifier returns null. 从框架标识符创建捆绑包返回空值。

How should it be done? 应该怎么做? Do Xamarin.iOS allows us to reference Framework Bundle and how to find it? Xamarin.iOS是否允许我们引用Framework Bundle,以及如何找到它? Or should my binding library provides something that I am missing. 或者我的绑定库应该提供我所缺少的东西。

For anyone that looks for an answer - right now it's unresolved Xamarin bug. 对于任何寻求答案的人-现在它都是未解决的Xamarin错误。

https://bugzilla.xamarin.com/show_bug.cgi?id=12851 https://bugzilla.xamarin.com/show_bug.cgi?id=12851

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM