Positioning on iOS vs Android

Welcome! Forums Unity Plugins In-App Web Browser Positioning on iOS vs Android

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2181
    cyberben3d
    Participant

    I’m trying to position the web browser horizontally centered. I’m using this code:

    InAppBrowser.EdgeInsets insets = new InAppBrowser.EdgeInsets(0, 0, 100, 100);
    options.insets = insets;

    (top, bottom, left, right)

    On Android, it appears as expected, with the original app still visible in the background and equal space on either side of the browser.

    On iOS (iPad), all the space appears on the top and right side. The browser is flush with the bottom and left sides. The title bar appears across the entire top of the screen. And none of the original app is visible in the background (only solid black).

    Am I doing something wrong? On iOS, is there a way to have the web browser appear on top of the original app (Centered) with the original app still visible around the edges, so it’s like a popup? As it is now, it appears like a separate app.

    #2182
    cyberben3d
    Participant

    Through trial and error, I found the following works on iOS (the equivalent of above on Android)

    // android: top, bottom, left, right
    InAppBrowser.EdgeInsets insets = new InAppBrowser.EdgeInsets(0, 0, 100, 100);
    options.insets = insets;

    // ios: left, bottom, top, right
    InAppBrowser.EdgeInsets insets = new InAppBrowser.EdgeInsets(100, 0, 0, 100);
    options.insets = insets;

    I couldn’t get the original app to show behind the browser in iOS like it does on Android.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.