[英]Cordova : Inappbrowser breaks UI while Screen orientation changes from landscape to portrait on iOS
I am developing app using cordova 5.4.1, Also I am using latest InAppBrowser plugin. 我正在使用cordova 5.4.1开发应用程序,我也在使用最新的InAppBrowser插件。 Below are the steps to reproduce the issue.
以下是重现该问题的步骤。
I am using iOS 9.2.1 我正在使用iOS 9.2.1
Please let me know if some one has faced same issue and got fixed. 如果有人遇到相同问题并已解决,请告诉我。
Thank you in advance. 先感谢您。
I know it's a bit late but I wanted to share how I fixed this in case you or anyone else is having this issue. 我知道这有点晚了但是我想分享一下如果你或其他任何人遇到这个问题我如何解决这个问题。
As noted in the issue mentioned in jcesarmobile's comment, it appears that cordova-plugin-statusbar
& cordova-plugin-inappbrowser
don't play nice together. 正如在jcesarmobile的评论中提到的问题中指出的那样,似乎
cordova-plugin-statusbar
和cordova-plugin-inappbrowser
不能很好地配合使用。 The ticket status says resolved, although I'm still having this problem. 票务状态显示已解决,尽管我仍然遇到此问题。 To fix it you can either delete the plugin, or, if you need the plugin then you can add an event listener to hide then show it again on exit:
要修复它,你可以删除插件,或者,如果你需要插件,那么你可以添加一个事件监听器来隐藏然后在退出时再次显示它:
openUrl(url) {
let ref = cordova.InAppBrowser.open(url, '_blank', options);
ref.addEventListener('exit', () => {
StatusBar.hide();
StatusBar.show();
})
}
StatusBar.hide()
is what fixes the issue. StatusBar.hide()
是解决此问题的方法。
EDIT: As noted by René in the comments of this similar issue , a blank column exists in iPad with the fix noted above. 编辑:正如René在此类似问题的评论中所述,iPad中存在一个空白列,其中包含上述修复程序。 In order to completely fix the issue in both iPhone and iPad without having to remove the plugin, wrap the
StatusBar.show()
call inside a setTimeout of a second: 为了在iPhone和iPad上完全解决此问题而不必删除插件,请将
StatusBar.show()
调用包装在setTimeout的秒内:
openUrl(url) {
let ref = cordova.InAppBrowser.open(url, '_blank', options);
ref.addEventListener('exit', () => {
StatusBar.hide();
setTimeout( () => {
StatusBar.show();
}, 1000)
})
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.