DocumentPickerが完全に機能するようになっています。今はビューコントローラを提示しますが、結果を待つ方法や結果を得る方法がわかりません。XamarinフォームでのUIDocumentPickerViewControllerの選択
すぐにvoid documentPicker(UIDocumentPickerViewController controller, didPickDocumentAtUrl...
メソッドを書きます。終了したらそこに行きます。
しかし、Xamarinでは、単純ではありません。私はそれを私のAppDelegate.cs
クラスだけでなく、私のMain.cs
クラスと同様に呼び出すクラスから、そのメソッドを書いています。私が間違って書いていない限り、それはうまくいかないようです。
私は何を持っていることは
public async Task<string> pickResume()
{
string path = string.Empty;
var controller = new UIViewController();
var docVC = new UIDocumentPickerViewController(new string[] { "org.openxmlformats.wordprocessingml.document", "com.microsoft.word.doc" }, UIDocumentPickerMode.Import);
UIViewController topController = getTopViewController();
topController.PresentViewController(docVC, true, null);
return path;
}
void documentPicker(UIDocumentPickerViewController controller, NSUrl didPickDocumentAtURL)
{
Console.WriteLine("done");
}
getTopViewController()