Monotouch.Dialog IOS 6分割视图旋转问题

BUMP ..还没有想出这个,事情旋转,但在视野外。 太奇怪了。 我可以提供更好的信息来获得帮助吗?

仍然有这个问题! 它真的很糟糕,我不能解决这个:(帮助请

BUMP ..请在这里死亡! 任何人! 🙂

所以,我使用Monotouch.Dialog ,自IOS 6以来,我的splitview控制器的旋转是奇怪的。

它实际上是旋转的,但是我的细节视图占据了整个屏幕,而主视图看起来好像正在旋转离开屏幕框。 也就是说,当它旋转的时候,我可以看到主视图一瞬间,细节视图占据整个屏幕。

我已经添加了必要的ShouldAutorotate函数,并设置了自ShouldAutorotate以来的GetSupportedInterfaceOrientations 。就像我说的旋转,但有些东西刚刚closures。

我已经尝试了IOS 5模拟器,它的工作,所以这绝对是一个IOS 6的问题。

任何人有一个想法,我应该在哪里寻找问题?

编辑:我注意到,而debugging时,它不进入我的主视图和详细信息视图的ShouldAutorotate重写,只有在我的分割视图控制器它进去。在iOS 5中它正确地进入了ShouldAutorotateToInterfaceOrientation。

以下是我在Detail和Master视图中使用的代码:

 public override bool ShouldAutorotate() { return true; } [Obsolete] public override bool ShouldAutorotateToInterfaceOrientation (MonoTouch.UIKit.UIInterfaceOrientation toInterfaceOrientation) { return true; } 

这里是我的SplitViewController中的代码:

 public override bool ShouldAutorotate() { return true; } [Obsolete] public override bool ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientation requested) { return requested == UIInterfaceOrientation.LandscapeRight || requested == UIInterfaceOrientation.LandscapeLeft; //return requested == UIInterfaceOrientation.Portrait || requested == UIInterfaceOrientation.PortraitUpsideDown; } public override bool ShouldAutomaticallyForwardRotationMethods { get { return true; } } 

有人吗? 我需要这个工作,我不能解决这个问题! 任何想法都会有所帮助!

如果没有看到代码本身,就很难猜测出现了什么问题。 它可能在iOS 5.x上工作,因为它将调用旧的shouldAutorotateToInterfaceOrientation:select器(因为你的应用程序和/或MonoTouch.Dialog已经支持)。

这在iOS6中弃用 – 但仍然会被调用以实现向后兼容性,除非您实施replace。 请注意来自Apple文档的复数formsreplace

改写supportedInterfaceOrientations和preferredInterfaceOrientationForPresentation方法。)

弃用声明并不意味着iOS6将不适用于旧的API。 剩下的就是一些新的,更好的API被添加了,并且旧的API 可以在未来的iOS版本中删除(清除已经非常less见)。

注意:我鼓励你停止使用你不支持的iOS版本中的旧API(例如iOS 4.0中不推荐使用的应用程序只能在支持5.0和更高版本的应用程序中使用)。 但是,重复代码以支持5.0和6.0 最好的 API可能不是一个好主意,除非你从中获得某些东西(例如新function)。

大多数新的API,贬低旧的API,是为了让你的生活更轻松,而不是更难。

另外不要忘记设置window.rootViewController (否则旋转将无法在iPad上运行)。