[英]How make iOS UIActivityViewController show “Open in Google Earth” for local KML file?
使用iOS Mail應用程序:
如何使我的應用程序與iOS郵件應用程序一樣工作?
當我使用UIActivityViewController並創建指向本地KML文件的NSURL時,將出現AirDrop頁面,其中顯示郵件,Facebook,Gmail,但不顯示 “在Google Earth中打開”?
NSURL* urlToLocalKmlFile=[NSURL fileURLWithPath:localKmlFilePath];
NSArray *objectsToShare = @[urlToLocalKmlFile];
activityViewController = [[UIActivityViewController alloc]
initWithActivityItems:objectsToShare
applicationActivities:nil];
iOS Mail如何與Goggle Earth共享KML文件附件或與Adobe Acrobat共享PDF文件附件?
預先感謝您的任何提示或建議,-Ed
您應該看一下Apple的UIDocumentInteractionController的文檔。
我已經嘗試過了,使用該控制器時會出現“ 在GoogleEarth中打開”選項。 例如,從視圖控制器中名為url
的路徑的按鈕(稱為button
)呈現它:
UIDocumentInteractionController *interactionController = [UIDocumentInteractionController interactionControllerWithURL:url];
[interactionController presentOpenInMenuFromRect:button.frame inView:self.view animated:YES];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.