【问题标题】:Phonegap-Plugin ExternalFileUtil doesn't work on all devicesPhonegap-Plugin ExternalFileUtil 不适用于所有设备
【发布时间】:2013-05-10 11:47:16
【问题描述】:

我正在使用来自 Phonegap (https://github.com/phonegap/phonegap-plugins/tree/master/iOS/ExternalFileUtil) 的 ExternalFileUtil-Plugin。但它只适用于 iPhone。它适用于带有 iOS 6.0 和 6.1 的 iPhone 模拟器,适用于带有 iOS 6.x 的 iPhone 4 和 5。但它不适用于 iPad、模拟器、设备和带有 iOS 5.1 的 iPod Touch 上也不起作用;(

我尝试了http://www.tricedesigns.com/2012/08/15/open-with-in-ios-phonegap-apps/ 上的 cmets 中描述的任何建议,但没有任何帮助。

我认为以下几行必须调整:

UIDocumentInteractionController *controller = [UIDocumentInteractionController  interactionControllerWithURL:fileURL];
controller.delegate = self;
controller.UTI = uti;
[controller retain];

CDVViewController* cont = (CDVViewController*)[ super viewController ];
CGRect rect = CGRectMake(0, 0, cont.view.bounds.size.width, cont.view.bounds.size.height);
[controller presentOptionsMenuFromRect:rect inView:cont.view animated:YES];

有人有什么建议吗?

【问题讨论】:

    标签: ios objective-c cordova phonegap-plugins


    【解决方案1】:

    我目前对此问题的解决方案:替换

    CGRect rect = CGRectMake(0, 0, cont.view.bounds.size.width, cont.view.bounds.size.height);
    

    有了这个

    CGRect rect = CGRectMake(0, 0, 1500.0f, 50.0f);
    

    它就像一个魅力。感谢 Mahendra Liya(请参阅tricedesigns.com 的评论)。

    【讨论】:

      猜你喜欢
      • 2012-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-07
      • 2018-03-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多