简体   繁体   English

MVVMCross iOS支持的方向

[英]MVVMCross iOS Supported Orientations

With the update of iOS(Monotouch) to 6, the method of choosing whether or not to rotate is no longer dependent solely on the ViewController. 随着iOS(Monotouch)更新到6,选择是否旋转的方法不再仅取决于ViewController。
With GetSupportedInterfaceOrientations and ShouldAutorotate being the method of doing so now, it is necessary to control the RootViewController. 现在使用GetSupportedInterfaceOrientations和ShouldAutorotate作为这样做的方法,有必要控制RootViewController。 Otherwise the local override methods value will just be ignored. 否则,本地覆盖方法的值将被忽略。
Doing this in Objective C or even is straight Monotouch is pretty straight forward, but MVVMCross seems to handle most of the Pushing and Popping of the ViewControllers in the background, I am unable to get these methods to work with MVVMCross. 在Objective C甚至是简单的Monotouch中做到这一点很简单,但是MVVMCross似乎可以在后台处理ViewControllers的大多数推送和弹出操作,因此我无法使这些方法与MVVMCross一起使用。

Is there some way of controlling orientation properly with MVVMCross and iOS6 or is it just not supported yet? 是否可以通过MVVMCross和iOS6正确控制方向,还是尚不支持?

MvvmCross pushes and pops the viewcontrollers via a component called the presenter. MvvmCross通过称为presenter的组件推送和弹出视图控制器。 This is what provides the RootController and helps it interact with its children. 这就是提供RootController并帮助其与其子级进行交互的原因。

It's easy to customise and override the presenter in the App Setup.cs process - you can implement and return your custom presenter in protected override IMvxTouchViewPresenter CreatePresenter() . 在App Setup.cs流程中自定义和覆盖演示者很容易-您可以在protected override IMvxTouchViewPresenter CreatePresenter()实现并返回自定义演示者。

For some examples on this, see http://slodge.blogspot.co.uk/2013/06/presenter-roundup.html 有关此示例,请参阅http://slodge.blogspot.co.uk/2013/06/presenter-roundup.html

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

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