【问题标题】:How can I open txt file from Icloud drive using Xamarin.Essentials: File Picker?如何使用 Xamarin.Essentials:文件选择器从 Icloud 驱动器打开 txt 文件?
【发布时间】:2021-04-22 12:48:12
【问题描述】:

请帮助我在 iPhone 上打开 txt 文件。

private async  Task ExecuteOpenFileCommandAsync()
    {
        Device.BeginInvokeOnMainThread(async () =>
        {
            var customFileType =
                new FilePickerFileType(new Dictionary<DevicePlatform, IEnumerable<string>>
                {
                    { DevicePlatform.iOS, new[] { "blablabla" } },
                    { DevicePlatform.Android, new[] { "text/plain" } }
                });
            var options = new PickOptions
            {
                PickerTitle = "Please select a file",
                FileTypes = customFileType,
            };
            await PickAndShow(options);
        });
    }

我不知道,我需要写什么来代替“blablabla”

谢谢。

【问题讨论】:

    标签: ios xamarin.forms filepicker xamarin.essentials


    【解决方案1】:

    我发现答案“public.text”解决了这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-04-07
      • 2015-01-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-01
      相关资源
      最近更新 更多