Cordova iOS-InAppBrowser始终是头号问题 [英] Cordova iOS - InAppBrowser always on top issue

查看:156
本文介绍了Cordova iOS-InAppBrowser始终是头号问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个Apache Cordova应用程序.我添加了InAppBrowser插件和条形码扫描器插件,它们是通过跨浏览器通信从InAppBrowser内部打开的页面中调用的.它在Android中运行良好.但是,当在iOS中运行时,InAppBrowser的行为就像一个模式弹出窗口,并且直到InAppBrowser关闭/关闭后才允许条形码扫描仪出现.

I am creating an Apache Cordova app. I have added InAppBrowser plugin and barcode scanner plugin that is invoked from the page opened inside InAppBrowser through cross browser communication. It is running perfectly fine in Android. But when ran in iOS, the InAppBrowser acts like a modal pop-up and doesn't let barcode scanner appear until the InAppBrowser is closed/dismissed.

我已经确认条形码扫描仪即使在后台也能正常工作,但由于InAppBrowser始终位于顶部,因此它不会出现.

I have confirmed that barcode scanner is working even when in background but it just won't appear because the InAppBrowser is always on top.

我在想可能有一种解决方法,可为条形码扫描仪插件提供最大的z-index,但我不知道怎么做.

I'm thinking that there could be a workaround to give barcode scanner plugin maximum z-index but I cannot figure out how.

我还试图隐藏InAppBrowser,但在iOS中不起作用.

I also tried to hide the InAppBrowser, but it didn't work in iOS.

cordova.InAppBrowser.hide();

我的想法是扩展我的网站,使其在从其移动应用程序运行时使用本机功能.

My idea is to extend my website to use native features when running from its mobile app.

推荐答案

我忘了在此处添加答案.但是第二天我修复了它.修复非常简单,我将InAppBrowser的hide和show方法更改为以下内容:

I forgot to add an answer here. But I fixed it the very next day. The fix is very straight forward, I changed the hide and show methods of InAppBrowser to the following:

- (void)hide:(CDVInvokedUrlCommand*)command {
 self.inAppBrowserViewController.viewController.hidden = YES;
}

- (void)hide:(CDVInvokedUrlCommand*)command {
 self.inAppBrowserViewController.viewController.hidden = NO;

}

这篇关于Cordova iOS-InAppBrowser始终是头号问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆