How to prevent to open title menu of QLPreviewController - Xamarin.Forms iOS?

Pelin Konaray 291 Reputation points
2023-01-02T07:55:07.643+00:00

Hello,

I open a file using the QLPreviewController to preview it from within the Xamarin.Forms iOS app.
I turn off the "Open In" button to prevent the file from being exported to the application in QLPreviewController. However, after the latest iOS update on my test device (iPad), I saw that when the title in the Navigation bar is pressed, a menu opens and the "Open In" option is shown there.

How do I turn this off?

275350-screenshot-2023-01-02-at-103139.png

Developer technologies | .NET | Xamarin
0 comments No comments
{count} votes

Accepted answer
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,436 Reputation points Microsoft External Staff
    2023-01-03T07:51:29.577+00:00

    Hello,

    Normally (before updating iOS) you could turn off sharing by customizing the rightBarButtonItem of the navigationItem. I tested on iOS16, it doesn't work, and you cannot disable leftBarButtonItem and rightBarButtonItem. I try to get the navigationBar.Items[0].LeftBarButtonItems, the children could not be evaluated.

    Currently, you can create a new UIViewController and add the view of QLPreviewController to the UIViewController , then present this UIViewController, please refer to the following code:

    ---Update---

                UIViewController customVC = new UIViewController();  
                customVC.View.BackgroundColor = UIColor.White;  
                PdfPreviewController previewController = new PdfPreviewController();  
                previewController.DataSource = new MyQLPreviewControllerDataSource();// add if (File.Exists(file)) according to your needs  
                customVC.AddChildViewController(previewController);  
    
                previewController.View.Frame = new CoreGraphics.CGRect(0, 0, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height);// 20 is y of done button , 40 is height of done button  
                customVC.View.AddSubview(previewController.View);// add QLPreviewController.view to this customVC  
                UIButton doneButton = UIButton.FromType(UIButtonType.System);  
                doneButton.Frame = new CGRect(UIScreen.MainScreen.Bounds.Width - 40, 20, 40, 40);  
                doneButton.SetTitle("Done", UIControlState.Normal);  
                doneButton.TouchUpInside += delegate  
                {  
                    customVC.DismissModalViewController(true);// dismiss the customVC  
                };  
                ;//add done button on the viewcontroller  
                customVC.View.AddSubview(doneButton);  
                customVC.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;  
    
                UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(customVC, true, null);  
    

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Puneet Arora 11 Reputation points
    2023-04-14T08:16:15.8533333+00:00

    Just set titlemenuprovider and documentproperties to nil in viewdidappear.
    Apple and introduced these two new properties from iOS 16. It will hide the titlemenu from previewcontroller.

    if (@available(iOS 16.0, *)) {
            self.navigationItem.titleMenuProvider = nil;
            self.navigationItem.documentProperties = nil;
        }
    
    1 person found this answer helpful.

  2. Pelin Konaray 291 Reputation points
    2023-01-04T06:20:33.733+00:00

    Hello @Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) ,

    Thanks for reply. I tried your suggestion but UI is a bit confused like this:
    275887-unnamed.png

    Default done and share button don't closed and added our custom button to ui. I think I didn't implemented it correctly. Could you help me for this?

    The implementation I made to turn off the share button:

    using App.Helpers;  
    using App.iOS.CustomRenderer;  
    using App.Models;  
    using App.Views;  
    using Foundation;  
    using QuickLook;  
    using System;  
    using System.IO;  
    using System.Linq;  
    using UIKit;  
    using Xamarin.Forms;  
      
    [assembly: Dependency(typeof(DocumentView))]  
    namespace App.iOS.CustomRenderer  
    {  
        public class DocumentView : DocumentViewBase, IDocumentView  
        {  
            void IDocumentView.DocumentView(string file, string title)  
            {  
                try  
                {  
                    if (VideoAudioControl(file))  
                    {  
                        OpenVideoAudioPreview(file, title);  
                    }  
                    else  
                    {  
                        UIApplication.SharedApplication.InvokeOnMainThread(() =>  
                        {  
                            PdfPreviewController previewController = new PdfPreviewController();  
      
                            if (File.Exists(file))  
                            {  
                                previewController.DataSource = new PDFPreviewControllerDataSource(NSUrl.FromFilename(file), title);  
                                UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(previewController, true, null);  
                            }  
                            MessagingCenter.Send("ClosePreviewPopup", "ClosePreviewPopup");  
                        });  
                    }  
                }  
                catch (Exception ex)  
                {  
                    Helper.Log(ex, "IDocumentView.DocumentView", "DocumentView", "IDocumentView.DocumentView(string file, string title)");  
                }  
            }  
        }  
      
        public class PDFItem : QLPreviewItem  
        {  
            public PDFItem(string title, NSUrl uri)  
            {  
                this.Title = title;  
                this.Url = uri;  
            }  
            public string Title { get; set; }  
            public NSUrl Url { get; set; }  
            public override NSUrl ItemUrl { get { return Url; } }  
            public override string ItemTitle { get { return Title; } }  
        }  
      
        public class PDFPreviewControllerDataSource : QLPreviewControllerDataSource  
        {  
            PDFItem[] sources;  
      
            public PDFPreviewControllerDataSource(NSUrl url, string filename)  
            {  
                sources = new PDFItem[1];  
                sources[0] = new PDFItem(filename, url);  
            }  
      
            public override IQLPreviewItem GetPreviewItem(QLPreviewController controller, nint index)  
            {  
                int idx = int.Parse(index.ToString());  
                if (idx < sources.Length)  
                    return sources.ElementAt(idx);  
                return null;  
            }  
      
            public override nint PreviewItemCount(QLPreviewController controller)  
            {  
                return (nint)sources.Length;  
            }  
        }  
    }  
    
    using CoreGraphics;  
    using App.AppConfigManager.Models;  
    using Foundation;  
    using MaterialComponents;  
    using QuickLook;  
    using System;  
    using System.Linq;  
    using UIKit;  
    using Xamarin.Forms;  
    using static System.Net.Mime.MediaTypeNames;  
      
    namespace App.iOS.CustomRenderer  
    {  
        public class PdfPreviewController : QLPreviewController  
        {  
            public PdfPreviewController()  
            {  
                var aaa = this.NavigationItem;  
            }  
      
            public override void ViewWillAppear(bool animated)  
            {  
                base.ViewWillAppear(animated);  
      
                try  
                {  
                    BeginInvokeOnMainThread(() =>  
                    {  
                        ActionMenuControl();  
                    });  
                }  
                catch (Exception ex)  
                {  
                    Helpers.Helper.Log(ex, "ViewWillAppear", "App.iOS.CustomRenderer.PdfPreviewController", "ViewWillAppear(bool animated)");  
                }  
            }  
      
            public override void ViewWillLayoutSubviews()  
            {  
                base.ViewWillLayoutSubviews();  
      
                try  
                {  
                    BeginInvokeOnMainThread(() =>  
                    {  
                        ActionMenuControl();  
                    });  
                }  
                catch (Exception ex)  
                {  
                    Helpers.Helper.Log(ex, "ViewWillLayoutSubviews", "App.iOS.CustomRenderer.PdfPreviewController", "ViewWillLayoutSubviews()");  
                }  
            }  
      
            public override void ViewDidLayoutSubviews()  
            {  
                base.ViewDidLayoutSubviews();  
      
                try  
                {  
                    BeginInvokeOnMainThread(() =>  
                    {  
                        ActionMenuControl();  
                    });  
                }  
                catch (Exception ex)  
                {  
                    Helpers.Helper.Log(ex, "ViewDidLayoutSubviews", "App.iOS.CustomRenderer.PdfPreviewController", "ViewDidLayoutSubviews()");  
                }  
            }  
      
            public override void ViewDidAppear(bool animated)  
            {  
                base.ViewDidAppear(animated);  
      
                try  
                {  
                    BeginInvokeOnMainThread(() =>  
                    {  
                        ActionMenuControl();  
                    });  
                }  
                catch (Exception ex)  
                {  
                    Helpers.Helper.Log(ex, "ViewDidAppear", "App.iOS.CustomRenderer.PdfPreviewController", "ViewDidAppear()");  
                }  
            }  
      
            public override void SetNeedsStatusBarAppearanceUpdate()  
            {  
                base.SetNeedsStatusBarAppearanceUpdate();  
      
                try  
                {  
                    BeginInvokeOnMainThread(() =>  
                    {  
                        ActionMenuControl();  
                    });  
                }  
                catch (Exception ex)  
                {  
                    Helpers.Helper.Log(ex, "SetNeedsStatusBarAppearanceUpdate", "App.iOS.CustomRenderer.PdfPreviewController", "SetNeedsStatusBarAppearanceUpdate()");  
                }  
            }  
      
            public void ActionMenuControl()  
            {  
                try  
                {  
                    if (this.ChildViewControllers != null)  
                    {  
                        if (this.ChildViewControllers.Length != 0)  
                        {  
                            try  
                            {  
                                foreach (UINavigationController navigationController in this.ChildViewControllers.Where(x => x is UINavigationController))  
                                {  
                                    try  
                                    {  
                                        if (navigationController.View.Subviews != null)  
                                        {  
                                            if (navigationController.View.Subviews.Length != 0)  
                                            {  
                                                try  
                                                {  
                                                    foreach (UINavigationBar navigationBar in navigationController.View.Subviews.Where(x => x is UINavigationBar))  
                                                    {  
                                                        if (navigationBar != null)  
                                                        {  
                                                            if (navigationBar.Items != null)  
                                                            {  
                                                                if (navigationBar.Items.Length != 0)  
                                                                {  
                                                                    if (navigationBar.Items[0].RightBarButtonItems != null)  
                                                                    {  
                                                                        if (navigationBar.Items[0].RightBarButtonItems.Length != 0)  
                                                                        {  
                                                                            for (int i = 0; i < navigationBar.Items[0].RightBarButtonItems.Length; i++)  
                                                                            {  
                                                                                try  
                                                                                {  
                                                                                    string name = navigationBar.Items[0].RightBarButtonItems[i].Action?.Name;  
      
                                                                                    if (name == "_doneButtonTapped:")  
                                                                                        continue;  
      
                                                                                    if (name == "_toolbarButtonPressed:")  
                                                                                    {  
                                                                                        string image1 = navigationBar.Items[0].RightBarButtonItems[i].Image.ToString();  
                                                                                        if (image1.Contains("symbol(system: rectangle.and.pencil.and.ellipsis)"))  
                                                                                            continue;  
      
                                                                                        string image2 = navigationBar.Items[0].RightBarButtonItems[i].Image.ToString();  
                                                                                        if (image2.Contains("symbol(system: magnifyingglass)"))  
                                                                                            continue;  
                                                                                    }  
                                                                                      
                                                                                }  
                                                                                catch (Exception ex)  
                                                                                {  
                                                                                    Helpers.Helper.Log(ex, "_doneButtonTapped control error", "App.iOS.CustomRenderer.PdfPreviewController", "_doneButtonTapped control error");  
                                                                                }  
      
                                                                                navigationBar.Items[0].RightBarButtonItems[i].Enabled = false;  
      
                                                                                if (navigationBar.Items[0].RightBarButtonItems.Length > 1)  
                                                                                {  
                                                                                    foreach (UIBarButtonItem item in navigationBar.Items[0].RightBarButtonItems.Where(x => x.AccessibilityIdentifier == "QLOverlayMarkupButtonAccessibilityIdentifier"))  
                                                                                    {  
                                                                                        item.Enabled = false;  
                                                                                    }  
                                                                                }  
                                                                            }  
                                                                        }  
                                                                    }  
                                                                }  
                                                            }  
                                                        }  
                                                    }  
                                                }  
                                                catch (Exception ex)  
                                                { Helpers.Helper.Log(ex, "ActionMenuControl", "App.iOS.CustomRenderer.PdfPreviewController", "ActionMenuControl()"); }  
      
                                                try  
                                                {  
                                                    foreach (UIToolbar subview in navigationController.View.Subviews.Where(x => x is UIToolbar))  
                                                    {  
                                                        if (subview.Items != null)  
                                                        {  
                                                            if (subview.Items.Length != 0)  
                                                            {  
                                                                foreach (UIBarButtonItem item in subview.Items.Where(x => x.AccessibilityIdentifier == "QLOverlayDefaultActionButtonAccessibilityIdentifier"))  
                                                                {  
                                                                    try  
                                                                    {  
                                                                        string name = item.Action?.Name;  
      
                                                                        if (name == "_doneButtonTapped:")  
                                                                            continue;  
      
                                                                        if (name == "_toolbarButtonPressed:")  
                                                                        {  
                                                                            string image1 = item.Image?.ToString();  
                                                                            if (image1.Contains("symbol(system: rectangle.and.pencil.and.ellipsis)"))  
                                                                                continue;  
      
                                                                            string image2 = item.Image?.ToString();  
                                                                            if (image2.Contains("symbol(system: magnifyingglass)"))  
                                                                                continue;  
                                                                        }  
                                                                          
                                                                    }  
                                                                    catch (Exception ex)  
                                                                    {  
                                                                        Helpers.Helper.Log(ex, "_doneButtonTapped control error", "App.iOS.CustomRenderer.PdfPreviewController", "_doneButtonTapped control error");  
                                                                    }  
      
                                                                    item.Enabled = false;  
                                                                }  
                                                            }  
                                                        }  
                                                    }  
                                                }  
                                                catch (Exception ex)  
                                                { Helpers.Helper.Log(ex, "ActionMenuControl", "App.iOS.CustomRenderer.PdfPreviewController", "ActionMenuControl()"); }  
                                            }  
                                        }  
                                    }  
                                    catch (Exception ex)  
                                    { Helpers.Helper.Log(ex, "ActionMenuControl", "App.iOS.CustomRenderer.PdfPreviewController", "ActionMenuControl()"); }  
      
                                    try  
                                    {  
                                        if (navigationController.Toolbar != null)  
                                        {  
                                            if (navigationController.Toolbar.Items != null)  
                                            {  
                                                if (navigationController.Toolbar.Items.Length != 0)  
                                                {  
                                                    foreach (UIBarButtonItem item in navigationController.Toolbar.Items.Where(x => x.AccessibilityIdentifier == "QLOverlayDefaultActionButtonAccessibilityIdentifier"))  
                                                    {  
                                                        try  
                                                        {  
                                                            string name = item.Action?.Name;  
      
                                                            if (name == "_doneButtonTapped:")  
                                                                continue;  
      
                                                            if (name == "_toolbarButtonPressed:")  
                                                            {  
                                                                string image1 = item.Image?.ToString();  
                                                                if (image1.Contains("symbol(system: rectangle.and.pencil.and.ellipsis)"))  
                                                                    continue;  
      
                                                                string image2 = item.Image?.ToString();  
                                                                if (image2.Contains("symbol(system: magnifyingglass)"))  
                                                                    continue;  
                                                            }  
                                                              
                                                        }  
                                                        catch (Exception ex)  
                                                        {  
                                                            Helpers.Helper.Log(ex, "_doneButtonTapped control error", "App.iOS.CustomRenderer.PdfPreviewController", "_doneButtonTapped control error");  
                                                        }  
      
                                                        item.Enabled = false;  
                                                    }  
                                                }  
                                            }  
                                        }  
                                    }  
                                    catch (Exception ex)  
                                    { Helpers.Helper.Log(ex, "ActionMenuControl", "App.iOS.CustomRenderer.PdfPreviewController", "ActionMenuControl()"); }  
                                }  
                            }  
                            catch (Exception ex)  
                            { Helpers.Helper.Log(ex, "ActionMenuControl", "App.iOS.CustomRenderer.PdfPreviewController", "ActionMenuControl()"); }  
                        }  
                    }  
                }  
                catch (Exception ex)  
                {  
                    Helpers.Helper.Log(ex, "ActionMenuControl", "App.iOS.CustomRenderer.PdfPreviewController", "ActionMenuControl()");  
                }  
            }  
        }  
    }  
    

    After your suggestion I did this:

    using App.Helpers;  
    using App.iOS.CustomRenderer;  
    using App.Models;  
    using App.Views;  
    using Foundation;  
    using QuickLook;  
    using System;  
    using System.IO;  
    using System.Linq;  
    using UIKit;  
    using Xamarin.Forms;  
      
    [assembly: Dependency(typeof(DocumentView))]  
    namespace App.iOS.CustomRenderer  
    {  
        public class DocumentView : DocumentViewBase, IDocumentView  
        {  
            void IDocumentView.DocumentView(string file, string title)  
            {  
                try  
                {  
                    if (VideoAudioControl(file))  
                    {  
                        OpenVideoAudioPreview(file, title);  
                    }  
                    else  
                    {  
                        UIApplication.SharedApplication.InvokeOnMainThread(() =>  
                        {  
                            PdfPreviewController previewController = new PdfPreviewController(file, title);  
      
                            if (File.Exists(file))  
                            {  
                                previewController.DataSource = new PDFPreviewControllerDataSource(NSUrl.FromFilename(file), title);  
                                UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(previewController, true, null);  
                            }  
                            MessagingCenter.Send("ClosePreviewPopup", "ClosePreviewPopup");  
                        });  
                    }  
                }  
                catch (Exception ex)  
                {  
                    Helper.Log(ex, "IDocumentView.DocumentView", "DocumentView", "IDocumentView.DocumentView(string file, string title)");  
                }  
            }  
        }  
      
        public class PDFItem : QLPreviewItem  
        {  
            public PDFItem(string title, NSUrl uri)  
            {  
                this.Title = title;  
                this.Url = uri;  
            }  
            public string Title { get; set; }  
            public NSUrl Url { get; set; }  
            public override NSUrl ItemUrl { get { return Url; } }  
            public override string ItemTitle { get { return Title; } }  
        }  
      
        public class PDFPreviewControllerDataSource : QLPreviewControllerDataSource  
        {  
            PDFItem[] sources;  
      
            public PDFPreviewControllerDataSource(NSUrl url, string filename)  
            {  
                sources = new PDFItem[1];  
                sources[0] = new PDFItem(filename, url);  
            }  
      
            public override IQLPreviewItem GetPreviewItem(QLPreviewController controller, nint index)  
            {  
                int idx = int.Parse(index.ToString());  
                if (idx < sources.Length)  
                    return sources.ElementAt(idx);  
                return null;  
            }  
      
            public override nint PreviewItemCount(QLPreviewController controller)  
            {  
                return (nint)sources.Length;  
            }  
        }  
    }  
      
      
    using CoreGraphics;  
    using App.AppConfigManager.Models;  
    using Foundation;  
    using MaterialComponents;  
    using QuickLook;  
    using System;  
    using System.Linq;  
    using UIKit;  
    using Xamarin.Forms;  
    using static System.Net.Mime.MediaTypeNames;  
      
    namespace App.iOS.CustomRenderer  
    {  
        public class PdfPreviewController : QLPreviewController  
        {  
            string file = "";  
            string title = "";  
            public PdfPreviewController(string file, string title)  
            {  
                this.file = file;  
                this.title = title;  
                var aaa = this.NavigationItem;  
            }  
      
            public override void ViewDidLoad()  
            {  
                base.ViewDidLoad();  
      
                UIButton clickbutton = UIButton.FromType(UIButtonType.System);  
                clickbutton.Frame = new CoreGraphics.CGRect(0, 90, 40, 40);  
                clickbutton.SetTitle("click", UIControlState.Normal);  
                View.AddSubview(clickbutton);// Add a click button for testing  
                UIViewController customVC = new UIViewController();// add a custonVC to present the QLPreviewController  
      
                // done button  
                UIButton doneButton = UIButton.FromType(UIButtonType.System);  
                doneButton.Frame = new CGRect(UIScreen.MainScreen.Bounds.Width - 40, 20, 40, 40);  
                doneButton.SetTitle("Done", UIControlState.Normal);  
                doneButton.TouchUpInside += delegate  
                {  
                    customVC.DismissModalViewController(true);// dismiss the customVC  
                };  
                customVC.View.AddSubview(doneButton);//add done button on the viewcontroller  
      
                // QLPreviewController and the DataSource, you can replace it by yours  
                var vc = new QLPreviewController();  
                vc.DataSource = new PDFPreviewControllerDataSource(NSUrl.FromFilename(file), title);  
                customVC.AddChildViewController(vc);  
      
                vc.View.Frame = new CoreGraphics.CGRect(0, 0, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height - 20 - 40);// 20 is y of done button , 40 is height of done button  
                customVC.View.AddSubview(vc.View);// add QLPreviewController.view to this customVC  
                customVC.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;  
                // click the button to present   
                clickbutton.TouchUpInside += delegate  
                {  
                    // present the customVC  
                    this.PresentViewController(customVC, true, null);  
                };  
            }  
        }  
    }  
    

    But UI mixed like above image. Could you assist me?


  3. Pelin Konaray 291 Reputation points
    2023-01-05T14:41:46.96+00:00

    Hello @Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) ,
    This is worked for iOS 16.1 devices. Thank you very much. But I try it in the iPhone 8 iOS 15.5 simulator, there are an issue like this.

    Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[2]\nNative stack trace:\n\t0   CoreFoundation                      0x000000010b3cc604 __exceptionPreprocess + 242\n\t1   libobjc.A.dylib                     0x0000000110ac3a45 objc_exception_throw + 48\n\t2   CoreFoundation                      0x000000010b44dc63 _CFThrowFormattedException + 200\n\t3   CoreFoundation                      0x000000010b458137 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:].cold.5 + 0\n\t4   CoreFoundation                      0x000000010b43a928 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 243\n\t5   CoreFoundation                      0x000000010b3cb258 +[NSDictionary dictionaryWithObjects:forKeys:count:] + 49\n\t6   QuickLook                           0x000000010ba9d5de __49+[QLItem(PreviewInfo) contentTypesToPreviewTypes]_block_invoke + 484\n\t7   libdispatch.dylib                   0x00000001155edb25 _dispatch_client_callout + 8\n\t8   libdispatch.dylib                   0x00000001155eecdd _dispatch_once_callout + 20\n\t9   QuickLook                           0x000000010ba9d3f8 +[QLItem(PreviewInfo) contentTypesToPreviewTypes] + 46\n\t10  QuickLook                           0x000000010ba9dd39 -[QLItem(PreviewInfo) _uncachedPreviewItemTypeForContentType:] + 117\n\t11  QuickLook                           0x000000010ba9e2a6 -[QLItem(PreviewInfo) _previewItemTypeForType:] + 150\n\t12  QuickLook                           0x000000010ba9e0ac -[QLItem(PreviewInfo) _getPreviewItemType] + 61\n\t13  QuickLook                           0x000000010bb254da -[QLItem previewItemType] + 59\n\t14  QuickLook                           0x000000010bad4d1d +[QLItemFetcherFactory fetcherForPreviewItem:] + 90\n\t15  QuickLook                           0x000000010bb24ba3 -[QLItem fetcher] + 44\n\t16  QuickLook                           0x000000010ba88828 -[QLPreviewController previewItemAtIndex:withCompletionHandler:] + 153\n\t17  QuickLook                           0x000000010babe7af __63-[QLPreviewItemStore previewItemAtIndex:withCompletionHandler:]_block_invoke + 262\n\t18  QuickLook                           0x000000010baf2629 QLRunInMainThread + 51\n\t19  QuickLook                           0x000000010babe67a -[QLPreviewItemStore previewItemAtIndex:withCompletionHandler:] + 181\n\t20  QuickLook                           0x000000010ba82847 -[QLPreviewController internalCurrentPreviewItem] + 222\n\t21  QuickLook                           0x000000010bb02148 -[QLPreviewController(Overlay) _actionButton] + 344\n\t22  QuickLook                           0x000000010bb02824 -[QLPreviewController(Overlay) _toolBarButtonsWithTraitCollection:] + 1147\n\t23  QuickLook                           0x000000010bb00307 -[QLPreviewController(Overlay) _updateOverlayButtonsIfNeededWithTraitCollection:animated:updatedToolbarButtons:] + 129\n\t24  QuickLook                           0x000000010baff9aa -[QLPreviewController(Overlay) updateOverlayAnimated:animatedButtons:forceRefresh:withTraitCollection:] + 152\n\t25  QuickLook                           0x000000015038f955 -[QLPreviewControllerAccessibility updateOverlayAnimated:animatedButtons:forceRefresh:withTraitCollection:] + 84\n\t26  QuickLook                           0x000000010ba826af -[QLPreviewController _setCurrentPreviewItemIndex:updatePreview:animated:] + 230\n\t27  QuickLook                           0x000000010ba883be -[QLPreviewController reloadData] + 418\n\t28  App.iOS                       0x000000010297ee8c xamarin_dyn_objc_msgSendSuper + 220\n\t29  ???                                 0x000000014e1ea6a2 0x0 + 5605598882\n\t30  ???                                 0x0000000148b73746 0x0 + 5514934086\n\t31  Mono                                0x000000010bd070b5 mono_jit_runtime_invoke + 1621\n\t32  Mono                                0x000000010befc1e8 mono_runtime_invoke_checked + 136\n\t33  Mono                                0x000000010beffb0e mono_runtime_invoke + 142\n\t34  App.iOS                       0x000000010297621b xamarin_invoke_trampoline + 6219\n\t35  App.iOS                       0x000000010297da09 xamarin_arch_trampoline + 105\n\t36  App.iOS                       0x000000010297ebee xamarin_x86_64_common_trampoline + 118\n\t37  QuickLook                           0x000000010ba7f823 -[QLPreviewController viewWillAppear:] + 398\n\t38  App.iOS                       0x000000010297ee8c xamarin_dyn_objc_msgSendSuper + 220\n\t39  ???                                 0x000000014e2389c4 0x0 + 5605919172\n  
    

    I am trying solve this now.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.