iOS 11中UIDocumentMenuViewController的替代方案

问题描述 投票:4回答:1

是否可以在iOS 11中实现UIDocumentMenuViewController(在iOS 11中已弃用)的外观?我在iOS 11中找到的最接近的是UIDocumentPickerViewController,但是这不允许我显示文档提供者的菜单,而是以模态方式显示最近使用的文档提供者的全屏。

如果没有与UIDocumentMenuViewController相同的替代方法,是否至少有一种方法可以强制UIDocumentPickerViewController直接进入“Locations”vs显示最近使用的文档提供程序?

期望的结果:enter image description here

swift ios11 uidocumentpickerviewcontroller
1个回答
0
投票

你可以使用UIAlertController和UIAlertControllerStyle.ActionSheet.I有Xamarin.ios代码。

var okCancelAlertController = UIAlertController.Create("", "Choose", 
UIAlertControllerStyle.ActionSheet);
//Add Actions
okCancelAlertController.AddAction(UIAlertAction.Create("iCloud", UIAlertActionStyle.Default, (s) => { }));
okCancelAlertController.AddAction(UIAlertAction.Create("Photos", UIAlertActionStyle.Default, (s) => { }));
okCancelAlertController.AddAction(UIAlertAction.Create("Cancel", UIAlertActionStyle.Cancel, (s) => { }));
UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(okCancelAlertController, true, null);
© www.soinside.com 2019 - 2024. All rights reserved.