Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Xamarin.Forms + UIDocumentInteractionController.PresentOpenInMenu

$
0
0

I need to open a file in a different app. For this I used PresentOpenInMenu in my old Xamarin iOS app which I now want to port to Xamarin.Forms.

Unfortunately the other app does not open.

My code looks like this:

`

        bool rc = false;
        Xamarin.Forms.Device.BeginInvokeOnMainThread(() => {

            var window = UIApplication.SharedApplication.KeyWindow;
            var subviews = window.Subviews;             // returns just one UIView
            var view = subviews.Last();

            var uidic = UIDocumentInteractionController.FromUrl(new NSUrl(fullpath, true));
            rc = uidic.PresentOpenInMenu(view.Frame, view, true);
        });
        return rc;

`

PresentOpenInMenu returns true, but nothing happens on my iPad.

There is however an error written to the output window:

2014-09-17 10:20:34.866 RoyalTSi[1244:60b] Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
    "<NSLayoutConstraint:0x17e92fc0 H:|-(0)-[UIView:0x194cb630]   (Names: '|':UIActivityGroupView:0x194f1bf0 )>",
    "<NSLayoutConstraint:0x194cf1a0 H:[UIView:0x194cb630]-(0)-|   (Names: '|':UIActivityGroupView:0x194f1bf0 )>",
    "<NSLayoutConstraint:0x194f5460 H:|-(0)-[SFAirDropIconView:0x19377020](LTR)   (Names: '|':UIView:0x194cb630 )>",
    "<NSLayoutConstraint:0x19375c10 H:[SFAirDropIconView:0x19377020]-(15)-[UILabel:0x194f5490](LTR)>",
    "<NSLayoutConstraint:0x19375d90 UILabel:0x194f54
90.right == UIView:0x194cb630.right - 12>",
    "<NSLayoutConstraint:0x194f4f20 H:[SFAirDropIconView:0x19377020(76)]>",
    "<NSLayoutConstraint:0x194f5bf0 H:|-(0)-[UIView:0x193f0140]   (Names: '|':UIView:0x193f72a0 )>",
    "<NSLayoutConstraint:0x194f5c30 H:[UIView:0x193f0140]-(0)-|   (Names: '|':UIView:0x193f72a0 )>",
    "<NSLayoutConstraint:0x194f5d10 UIActivityGroupView:0x194f1bf0.width == UIView:0x193f0140.width>",
    "<NSAutoresizingMaskLayoutConstraint:0x19464e60 h=-&- v=-&- UIView:0x193f72a0.width == UIView:0x193f0720.width>",
    "<NSAutoresizingMaskLayoutConstraint:0x19464640 h=-&- v=-&- UIView:0x193f0720.width == UIView:0x19474260.width>",
    "<NSAutoresizingMaskLayoutConstraint:0x19463c40 h=--& v=--& H:[UIView:0x19474260(0)]>"
)

But I do not understand this error in detail and I don't know how to change the constraints.
Maybe I just have the UIView wrong but I couldn't find a better method how to get it.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>