Phonegap-Plugin ExternalFileUtil不能在所有设备上使用 [英] Phonegap-Plugin ExternalFileUtil doesn't work on all devices
问题描述
我使用Phonegap中的ExternalFileUtil-Plugin( https:/ /github.com/phonegap/phonegap-plugins/tree/master/iOS/ExternalFileUtil )。但它的工作只有在iPhone。它工作在iPhone模拟器与iOS 6.0和6.1和工作在iPhone 4和5与iOS 6.x.但它不工作在iPad上,无论在模拟器上没有在设备和iPod Touch与iOS 5.1它不工作太;(
我试过任何在 http://的意见中描述的建议www.tricedesigns.com/2012/08/15/open-with-in-ios-phonegap-apps/ 但没有任何帮助我。
在我的意见必须调整以下行:
UIDocumentInteractionController * controller = [UIDocumentInteractionControllerinteractionControllerWithURL: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];
解决方案 div> 我的当前解决方案这个问题:替换
CGRect rect = CGRectMake(0,0,cont.view。 bounds.size.width,cont.view.bounds.size.height);
$ b code> CGRect rect = CGRectMake(0,0,1500.0f,50.0f);
它的作用就像一个魅力。感谢Mahendra Liya(请参阅 tricedesigns.com )。
I'm using the ExternalFileUtil-Plugin from Phonegap (https://github.com/phonegap/phonegap-plugins/tree/master/iOS/ExternalFileUtil). But it work's only at iPhone. It work's on iPhone-simulator with iOS 6.0 and 6.1 and work's on iPhone 4 and 5 with iOS 6.x. But it doesn't work on iPad, neither on simulator nore on devices and on iPod Touch with iOS 5.1 it doesn't work too ;(
I've tried any suggestions described in the comments on http://www.tricedesigns.com/2012/08/15/open-with-in-ios-phonegap-apps/ but nothing helps me.
In my opinion the following lines must be adjusted:
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];
Have somebody any suggestions?
解决方案 My current solution for this issue: Replace
CGRect rect = CGRectMake(0, 0, cont.view.bounds.size.width, cont.view.bounds.size.height);
with this
CGRect rect = CGRectMake(0, 0, 1500.0f, 50.0f);
and it works like a charm. Thanks to Mahendra Liya (see comment on tricedesigns.com).
这篇关于Phonegap-Plugin ExternalFileUtil不能在所有设备上使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文