简体   繁体   English

Titanium WebView-有没有办法阻止它打开系统应用程序?

[英]Titanium WebView - Is there a way to stop it opening a system app?

I'm working on a very simple app at the moment that has a tabgroup which open's up various webviews containing different URLs. 目前,我正在开发一个非常简单的应用程序,该应用程序具有一个选项卡组,可以打开包含不同URL的各种Web视图。

One of the webviews is a google maps link, on the device I am using it has the Google Maps App installed. Webview之一是google maps链接,在我使用的设备上,它已安装了Google Maps App。 Instead of opening the link in the google maps website, it opens up the link in the App instead. 与其在Google Maps网站中打开链接,不如在应用程序中打开链接。 If I test the app in a simulator without the google maps app installed, the webview will load the website version instead. 如果我在未安装google maps应用程序的模拟器中测试该应用程序,则webview将改为加载网站版本。

Is there a way to stop the device from using the system app and force it to use the website instead? 有没有一种方法可以阻止设备使用系统应用程序并强制其使用网站? So far I have been unable to find any information. 到目前为止,我一直找不到任何信息。

Thanks. 谢谢。

I'm kind of surprised that the WebView is doing what you're describing. 我对WebView所做的事情感到惊讶。 I would expect it to directly load the contents of the URL you've provided, regardless of whether another app is registered for that URL scheme. 我希望它可以直接加载您提供的URL的内容,而不管是否已为该URL方案注册了另一个应用程序。 But I'll take your word for it. 但我会相信你的。

I have two ideas on this: 我对此有两个想法:

  • could you use ti.map instead of a google maps URL? 您可以使用ti.map代替Google Maps URL吗? I'm not sure what your map contains; 我不确定您的地图包含什么内容; this may not be practical for you 这可能对您不切实际

  • could you use HTTPClient to retrieve the HTML from the google maps URL, and then call WebView.setHtml() with that HTML? 您可以使用HTTPClient从Google Maps URL检索HTML,然后用该HTML调用WebView.setHtml()吗? I would imagine you might have to add a element to the HTML to get all the relative URLs in the page to work... 我想您可能必须向HTML添加元素才能使页面中的所有相对URL正常工作...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有没有一种方法可以使用Appcelerator Titanium在iOS WebView中修改上下文菜单? - Is there a way to modify context menu in iOS webView using Appcelerator Titanium? Titanium:在打开应用程序时检查iOS通知,而无需单击通知 - Titanium: Check iOS notifications upon opening the app without clicking the notification 在 Appcelerator Titanium 应用程序中打开另一个 window 不起作用 - Opening another window in an Appcelerator Titanium-app doesn't work 使用Titanium studio在Windows系统中进行iOS应用开发 - IOS App Development in Windows System using Titanium studio 打开和关闭WebView(WKWebView)时,iOS应用程序崩溃 - iOS app crashed while opening and closing the WebView (WKWebView) 我们可以避免在Safari中打开应用时出现webView内存问题吗? - Can we avoid webView memory issue opening the app in Safari? 这是启动和停止粒子系统的正确方法吗? - Is this the right way to start and stop a particle system 有没有办法在iOS应用的网络视图中使用Chrome? - Is there a way to use Chrome in a webview in an iOS app? Webview是否可以与本机iOS应用通信? - Any way for webview to communicate with native iOS app? 在iOS上打开时停止本机Web应用程序重新加载 - Stop native web app from reloading itself upon opening on iOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM