如果选择allowedTypes,NSOpenPanel不会搜索文件夹

时间:2017-01-11 17:31:33

标签: cocoa xamarin.mac nsopenpanel

我使用以下代码打开面板,它应该让您能够只选择图像

    openPanel = NSOpenPanel.OpenPanel;
    openPanel.FloatingPanel = true;
    openPanel.CanChooseFiles = true;
    openPanel.AllowsMultipleSelection = true;
    openPanel.CanChooseDirectories = false;
    openPanel.AllowedFileTypes = new string [] { "png", "jpeg", "jpg", "gif" };

    openPanel.BeginSheet (this.View.Window, (obj) => {
        if (obj == 1 && openPanel.Urls != null) {}

当它打开时,我无法搜索文件夹....但如果我启用CanChooseDirectories属性,如果也会搜索文件夹..

如何强制NSOpenPanel搜索文件夹,而不允许选择目录?

0 个答案:

没有答案