【问题标题】:Ionic InAppBrowser no done/close button iOSIonic InAppBrowser 没有完成/关闭按钮 iOS
【发布时间】:2017-05-18 06:28:14
【问题描述】:

请参阅附件 sn-p 我用于 inappbrowser。我已经使用带有位置和工具栏的“_blank”=yes 链接在 inappbrowser 中打开,但没有后退按钮或完成按钮。 我试过用'_self'替换'_blank',但这没有任何区别。 由于这对我不起作用,我决定最好在系统浏览器中打开链接并将“_self”替换为“_system”,但这不起作用。链接根本打不开。 当我在浏览器中测试时,所有 3 都运行良好,但是在 iOS 模拟器上进行模拟或在 iOS 设备上进行测试时,我面临上述问题。

我已经阅读了很多关于堆栈溢出和 ionic 论坛的帖子,并尝试了几乎所有提供的解决方案,但没有一个对我有用。在 iOS 中使用 ionic 似乎是一个错误。谁有其他解决方案?

〈a ng-href="https://facebook.com" target="_self" ng-click="cordova.InAppBrowser.open('https://facebook.com','_self', 'location=yes, toolbar=yes'); return false;"〉test〈/a〉

Ionic 1,Xcode 版本 8.3.2,iOS 9,cordova-plugin-inappbrowser spec="^1.7.1"

【问题讨论】:

  • ionic1 或 ionic2
  • Ionic 1,Xcode 版本 8.3.2
  • <a class="item" href="#" onclick="window.open('http://www.facebook.com', '_system', 'location=yes'); return false;"> click here </a>
  • facebook.com', '_system', 'location=yes'); return false;"> 点击这里 这不起作用。以某种方式重定向到登录页面

标签: ios angularjs ionic-framework inappbrowser


【解决方案1】:

我已签入我以前的应用程序。代码工作正常。

查看此 github 存储库以获取示例代码:https://github.com/varunaaruru/ionic1-inappbrowser

安装插件:

ionic cordova 插件添加cordova-plugin-inappbrowser

在 html 文件中:

<a  href="#" onclick="window.open('http://www.facebook.com', '_system', 'location=yes'); return false;">
    click here
</a>

您可以使用blankself 代替system

【讨论】:

  • 这正是我过去 2 天一直在做的事情,但没有出现“关闭”/“完成”选项。
【解决方案2】:

这解决了我的问题。如果您的 config.xml 文件中不存在以下代码,请添加以下代码:

<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />

根据您在项目中使用的超链接添加 href。

【讨论】:

    【解决方案3】:

    添加以下行:

       const iosoption: InAppBrowserOptions = {
          zoom: 'no',
          location:'yes',
          toolbar:'yes',
          clearcache: 'yes',
          clearsessioncache: 'yes',
          disallowoverscroll: 'yes',
          enableViewportScale: 'yes'
        }
    
     if (this.platform.is('ios')) {
          browser = this.inAppBrowser.create(this.ValidateUsers, '_blank', iosoption);
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多