GithubHelp home page GithubHelp logo

Comments (19)

dmonaldo avatar dmonaldo commented on July 2, 2024 5

I'm also experiencing this issue. Are there any plans to fix this?

from cordova-plugin-inappbrowser.

chrisetler avatar chrisetler commented on July 2, 2024 1

I found a solution but it only works with the toolbar positioned at the bottom.

It works by not hardcoding the height of the "blur" UItoolbar added behind the status bar to 20 and instead getting the value from the device, and by keeping a reference to the toolbar so that when the device orientation changes we can detect if the toolbar was hidden (as it is on the iPhone X) and hide our blur accordingly.

In CordovaInAppBrowser.h add the following to the CDVInAppBrowserNavigationController interface:

    @private
    UIToolbar* bgToolbar;

In CordovaInAppBrowser.m in viewDidLoad use this:

- (void) viewDidLoad {
 
    CGRect statusBarFrame = [self invertFrameIfNeeded:[UIApplication sharedApplication].statusBarFrame];

//don't hardcode the height
//    statusBarFrame.size.height =  STATUSBAR_HEIGHT;
    
    
    // simplified from: http://stackoverflow.com/a/25669695/219684
    bgToolbar = [[UIToolbar alloc] initWithFrame:statusBarFrame];
    bgToolbar.barStyle = UIBarStyleDefault;
    [bgToolbar setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
    [self.view addSubview:bgToolbar];
    
    //set the statusbar height    
    [self fixStatusBar];
    
    [super viewDidLoad];
}

Directly below the viewDidLoad method add this:

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
    [coordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
        // fix height after orientation change
         [self fixStatusBar];
    }];
}

-(void)fixStatusBar {
    CGRect statusBarFrame = [self invertFrameIfNeeded:[UIApplication sharedApplication].statusBarFrame];
    if([UIApplication sharedApplication].isStatusBarHidden) {
        statusBarFrame.size.height = 0;
    }
    
    [bgToolbar setFrame:statusBarFrame];


    
}

from cordova-plugin-inappbrowser.

ersatishverma avatar ersatishverma commented on July 2, 2024 1

Hi @noahcooper
Yes, manually edit Objective-C files not a good solution.

I switched to another plugin for ios devices
https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller
and it's working for me.

from cordova-plugin-inappbrowser.

alexyazvinsky avatar alexyazvinsky commented on July 2, 2024 1

Any update?

from cordova-plugin-inappbrowser.

vagishmm avatar vagishmm commented on July 2, 2024
  1. For this issue add iPhone X splash images in Images.xcassets. Automatically it will fix your UI issue.
    Please use below sizes for iPhone X

Device | Portrait size | Landscape size
iPhone XS Max | 1242px × 2688px | 2688px × 1242px
iPhone XS | 1125px × 2436px | 2436px × 1125px
iPhone XR | 828px × 1792px | 1792px × 828px
iPhone X | 1125px × 2436px | 2436px × 1125px

  1. For Bottom URL please use this options.
    location=no,toolbar=no,hardwareback=no

from cordova-plugin-inappbrowser.

ersatishverma avatar ersatishverma commented on July 2, 2024

Hi vagishmm
Thanks for reply

Have made changes that you have suggested.
The bottom URL problem resolved, many thanks.
But the status bar problem remains the same.
image

from cordova-plugin-inappbrowser.

vespino avatar vespino commented on July 2, 2024

@ersatishverma were you able fix this issue? Using the other splash images doesn't help, because those are not yet supported by Phonegap.

from cordova-plugin-inappbrowser.

ersatishverma avatar ersatishverma commented on July 2, 2024

Hi @vespino
yes, these splash images doesn't help me too.
and my issue remains the same is not fix yet.

from cordova-plugin-inappbrowser.

vespino avatar vespino commented on July 2, 2024

@ersatishverma I'm using this fork of themeable browser now: https://github.com/toontoet/cordova-plugin-themeablebrowser.git

from cordova-plugin-inappbrowser.

noahcooper avatar noahcooper commented on July 2, 2024

Any update on this issue? Most of us don't want to manually edit Objective-C files. :)

from cordova-plugin-inappbrowser.

Sagarkhenat avatar Sagarkhenat commented on July 2, 2024

I am also facing this issue,will the cordova plugin team look into this,the InApp browser is not functioning correctly for iPhoneX probablye because of it's notch design.

from cordova-plugin-inappbrowser.

ersatishverma avatar ersatishverma commented on July 2, 2024

@Sagarkhenat
I switched to another plugin for ios devices you can use this one its support all iPhone notch designs.
https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller

from cordova-plugin-inappbrowser.

noahcooper avatar noahcooper commented on July 2, 2024

+1 for cordova-plugin-safariviewcontroller. It is a much better experience on iOS.

from cordova-plugin-inappbrowser.

de-dan avatar de-dan commented on July 2, 2024

The safariviewcontroller might be the better choice for the average user, but unfortunately not in my case: the app is running/wrapped in a Citrix XenMobile environment, which currently supports only the UIWebView engine.

from cordova-plugin-inappbrowser.

clerkzhang avatar clerkzhang commented on July 2, 2024

Any update?

from cordova-plugin-inappbrowser.

thanveershah avatar thanveershah commented on July 2, 2024

Any Update?

from cordova-plugin-inappbrowser.

vadimwe avatar vadimwe commented on July 2, 2024

+++++

from cordova-plugin-inappbrowser.

NiklasMerz avatar NiklasMerz commented on July 2, 2024

Please check this issue about the removal of the "fake" statusbar #604

from cordova-plugin-inappbrowser.

jcesarmobile avatar jcesarmobile commented on July 2, 2024

closing as duplicate of #301

from cordova-plugin-inappbrowser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.