iOS 5.1的UISplitViewController问题 [英] UISplitViewController problems with IOS 5.1

查看:79
本文介绍了iOS 5.1的UISplitViewController问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题

我正在使用用于iOS 5.1的Monotouch 5.2.8进行编程.

但是,由于IOS 5.1更新了,我的iPad配置了UISplitViewController,因此将其停靠在 而不是显示为弹出框.

它与IOS 5.0兼容,但是在5.1中我遇到了这个问题.

这是我的UISplitViewController的源代码:

splitViewController = new UISplitViewController ();
splitViewController.WeakDelegate = detailViewController;                
splitViewController.ViewControllers = new UIViewController[] {
     navigationController,
     detailViewController                   
};

解决方案

摘自Apple的iOS 5.1 SDK发行说明:

在5.1中,UISplitViewController类采用了滑动显示 呈现左视图时的样式(以前仅在Mail中可见). 当演示文稿由广告客户发起时,使用此样式 由委托方法或由 在右视图内滑动手势.无需采用其他API 才能获得此行为,以及所有现有的API(包括 委托提供的UIPopoverController实例的 继续像以前一样工作.如果您的手势无法支持 应用程序,设置您的拆分视图的presentsWithGesture属性 控制器设置为否"以禁用手势.但是,禁用 不建议使用手势,因为它可以保留一致的用户 在所有应用程序中都有经验.

UIPopoverController并利用ShouldHideViewController委托方法.幸运的是,有了MonoTouch,我们可以在UISplitViewController类中将该方法作为属性使用,这使事情变得更加简单.

我确实有一个奇怪的行为.在Mac上使用iOS SDK 5.1,在iPad上使用iOS 5.1;在设备上,我得到的是滑动"外观,而在模拟器上,我得到的是旧的"弹出窗口外观.这是MonoTouch 5.2.4的最新稳定版本.此外,它不包含PresentsWithGesture属性.我尝试通过MonoTouch.ObjCRuntime消息传递将其值设置为false,但是没有运气.选择器始终返回true.因此,我无法取消滑动手势.

甚至尝试创建我自己的UIPopoverController并将其分配为拆分控制器中的主控器,以查看会发生什么.不起作用,因为UIPopoverController不是UIViewController ...

中的一些有用信息问题,针对ObjC.

I have a problem,

I am programming with Monotouch 5.2.8 for IOS 5.1.

But since the IOS 5.1 update my iPad configs the UISplitViewController so it is docked on the left side instead of presented as a popover.

It works with IOS 5.0 but in 5.1 i got this problem.

Here is the source code for my UISplitViewController:

splitViewController = new UISplitViewController ();
splitViewController.WeakDelegate = detailViewController;                
splitViewController.ViewControllers = new UIViewController[] {
     navigationController,
     detailViewController                   
};

解决方案

From Apple's iOS 5.1 SDK release notes:

In 5.1 the UISplitViewController class adopts the sliding presentation style when presenting the left view (previously only seen in Mail). This style is used when presentation is initiated either by the existing bar button item provided by the delegate methods or by a swipe gesture within the right view. No additional API adoption is required to obtain this behavior, and all existing API, including that of the UIPopoverController instance provided by the delegate, will continue to work as before. If the gesture cannot be supported in your app, set the presentsWithGesture property of your split view controller to NO to disable the gesture. However, disabling the gesture is discouraged because its use preserves a consistent user experience across all applications.

Here (login required).

UPDATE:

From what I understand on the above, we can kiss the automatic popover appearance of the master controller goodbye in iOS 5.1.

The only way I see is possible to keep the "old" appearance, is by implementing our own UIPopoverController and taking advantage of the ShouldHideViewController delegate method. Thankfully with MonoTouch, we have that method available as a property in the UISplitViewController class, making things a bit simpler.

I do get a strange behavior though. With iOS SDK 5.1 on my Mac and iOS 5.1 on my iPad; on the device, I get the "sliding" appearance, while on the simulator I get the "old", popover appearance. This is with MonoTouch 5.2.4, which is the latest stable version. Also, it does not contain a PresentsWithGesture property. I tried setting its value to false through MonoTouch.ObjCRuntime messaging, but no luck. The selector keeps returning true. So I cannot deactivate the swipe gesture.

Even tried creating my own UIPopoverController and assigning it as the master in the split controller to see what happens. Doesn't work because UIPopoverController is not a UIViewController...

Some useful info in this question, for ObjC.

这篇关于iOS 5.1的UISplitViewController问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆