ios - Ionic 2 InAppBrowser 选项不起作用

标签 ios angular cordova ionic2

inAppBrowser 可以运行并打开一个 URL,但我希望它在体验中更加无缝。几乎到了感觉你实际上没有离开应用程序的地步。每当我尝试传递它似乎不接受的任何选项时。在docs这看起来很简单,您只需传递一个用逗号分隔的长字符串,但它似乎不起作用。

我试过:

  const browser = this.iab.create('http://example.net','_self', "location=no,toolbar=no,closebuttoncaption=home,transitionstyle=fliphorizontal");

甚至:

 const browser = this.iab.create('http://example.net','_self', "location='no',toolbar='no',closebuttoncaption='home',transitionstyle='fliphorizontal'");

这些选项似乎都不适用。在 iOS 上,它似乎总是在底部的工具栏和顶部的 url/位置栏的 safari web View 中打开 URL...

还有其他人遇到过这种情况吗?我应该提到这种行为是针对 iOS 的

最佳答案

使用 '_blank' 而不是 '_self' 作为目标。

将此添加到您的 config.xml

<access origin="*" />
<allow-navigation href="*" />
<allow-intent href="*" />

关于ios - Ionic 2 InAppBrowser 选项不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45271269/

相关文章:

ios - 将 NSNumber 保存在 plist 中,不起作用

ios - 无法在 collectionView 中打印来自 api 的响应

javascript - 在 Angular2 中使用 d3.js

android - Android 上的 PhoneGap : Loading a WebApp from a remote server

objective-c - iOS:UIImagePickerController 问题

iOS UIView继承性能差

Angular 2 错误 : Unhandled Promise rejection: Template parse errors: More than one component:

css - 如何在不引用任何标签的情况下引用 Angular 组件的完整模板设置 CSS?

android - 接受变量的值到 SQLITE 执行语句

android - 实现照片共享应用程序的最佳方式