MvvmCross - 查看未加载(MvvmCross - View not loaded)
我将一个旧项目升级到Xamarin.iOS Unified和MvvmCross 4.1。
当我运行应用程序时,我得到以下异常:
MvvmCross.Platform.Exceptions.MvxException:未为MyView加载视图
我的课程看起来像:
MyView : MvxViewController<MyViewModel> {} MvxViewController<T> : UIViewController, IMvxBindingContextOwner, IUIWrappable where T : ViewModelBase ViewModelBase : MvxViewModel {}
我怀疑我在MyView上缺少接口或其他东西以使MvvmCross正常运行但我不确定这可能是什么接口。
我怀疑这是因为我已经不得不在View和它的ViewModel之间的映射中硬编码,以使MvvmCross能够通过与MyView相关联的反射/自动发现来查找ViewModel。 也就是说,在此错误之前,我无法找到关联的ViewModel错误。
如果我使MyView实现了IMvxIosView,那么这个错误就会消失,然后我会在我的代码中获得ViewModel上的空引用,所以某个地方没有实例化它需要的地方。 我的印象是,这应该由MvvmCross自动处理,但我可能错了。
我正在查看样本,例如https://github.com/MvvmCross/MvvmCross/wiki/Tip-Calc-A-Xamarin.iOS-UI-project
TipView包含的位置
public new TipViewModel ViewModel { get { return (TipViewModel) base.ViewModel; } set { base.ViewModel = value; } }
MyView的基础没有这样的ViewModel属性。 我错过了什么才能访问这个?
TipCalc的示例代码仍然引用Cirrious命名空间,因此可能发生了变化。
任何建议表示赞赏。 我是Xamarin和MvvmCross的新手(虽然在Windows / iOS开发方面经验丰富),但我无法找到最新的文档。
I upgraded an old project to Xamarin.iOS Unified and MvvmCross 4.1.
When I run the app, I get the following exception:
MvvmCross.Platform.Exceptions.MvxException: View not loaded for MyView
My classes look like:
MyView : MvxViewController<MyViewModel> {} MvxViewController<T> : UIViewController, IMvxBindingContextOwner, IUIWrappable where T : ViewModelBase ViewModelBase : MvxViewModel {}
I suspect I'm missing an interface or something on MyView to enable MvvmCross to operate correctly but I'm not sure what interface this might be.
I suspect this because I already had to hard code in mappings between the View and it's ViewModel, to enable MvvmCross to find the ViewModel through reflection/auto-discovery associated with MyView. That is, before this error, I was getting an unable to find associated ViewModel error.
If I make MyView implement IMvxIosView, this error goes away, and I then get a null reference on the ViewModel later on in my code, so somewhere that is not getting instantiated where it needs to. My impression was this should all be handled automatically by MvvmCross, but I might be wrong.
I'm looking at samples such as https://github.com/MvvmCross/MvvmCross/wiki/Tip-Calc-A-Xamarin.iOS-UI-project
where TipView contains
public new TipViewModel ViewModel { get { return (TipViewModel) base.ViewModel; } set { base.ViewModel = value; } }
MyView's base has no such ViewModel property. What am I missing to have access to this?
TipCalc's sample code is still referencing the Cirrious namespace, so it's possible things have changed.
Any suggestions are appreciated. I'm new to Xamarin and MvvmCross (although experienced in Windows/iOS development), and I'm having trouble finding up to date documentation.
原文:https://stackoverflow.com/questions/36583805
最满意答案
您的问题不在Flash中,而在于您将pdf转换为swf的方式。 pdf2swf的默认参数将导出以前版本的Flash的swf,确切地说是6。 因此,您需要在转换为更高版本时明确设置Flash版本,以便可以在时间轴中导入它(假设您使用的是AS3)。
使用此配置选项:-T,--flashversion num将SWF标头中的Flash版本设置为num。
查看此信息以获取更多信息: http : //wiki.swftools.org/index.php ? title = PDf2swf http://wiki.swftools.org/index.php?title=Pdf2swf_-s_parameters
Your problem is not in Flash but the way you're transforming the pdf to swf. The default parameters of pdf2swf will export the swf for a previous version of Flash, 6 to be exact. So you need to explicitly set the flash version when converting to a later version so that you can import it in your timeline (assuming u're using AS3).
Use this config option: -T , --flashversion num Set Flash Version in the SWF header to num.
View this for more information: http://wiki.swftools.org/index.php?title=Pdf2swf http://wiki.swftools.org/index.php?title=Pdf2swf_-s_parameters
相关问答
更多-
您没有embed标记中的wmode参数: ...
-
没有SWF文件的Flash?(Flash Without a SWF File?)[2023-09-27]
您可以随时向他们发送PDF,因为PDF支持交互式表单。 您需要一份Acrobat(或类似的工具,这里有其他选择),您的用户需要Acrobat Reader的免费副本。 可以将结果作为PDF或XML格式发送以进行处理。 PDF表单验证非常先进,可以包含Javascript。 You could always send them a PDF instead, since PDFs support interactive forms. You'd need one copy of Acrobat (or a si ... -
Flash Pro CS6 SWF动画不会与Java Script一起循环(Flash Pro CS6 SWF animation doesn't loop with Java Script)[2023-07-18]
试着像这样嵌入它。 看看是否有变化。相关文章
更多- [译文] 恶意软件行为综述 - A View on Current Malware Behaviors
- Android编程之仿微信显示更多文字的View
- Android编程之仿微信显示更多文字的View
- [15] 微信公众帐号开发教程第15篇-自定义菜单的view类型(访问网页)
- JasperReport报告查看和打印
- Java类加载体系
- springmvc freemarker 动态加载(不用重启tomcat立即生效)
- tomcat6 启动加载项目时报内存溢出 急
- 【转】异步加载图片,使用LruCache和SD卡或手机缓存,效果非常的流畅
- hibernate延迟加载
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)