I am currently building a News Aggregator App and I am using InAppBrowser for people to read the articles. Now, my questions is:
Can I remove the URL and Navigation Bar?
Also, can I change the "Done" button text?
To remove the URL, just set the location option to "no".
var ref = window.open('http://apache.org', '_blank', 'location=no');
Recent versions of Cordova/PhoneGap now allow you to change the 'Done' button text by adding a 'closebuttoncaption' option.
var ref = window.open('http://apache.org', '_blank', 'closebuttoncaption=My Button Name');
As danw mentioned, you can now also remove the entire toolbar by setting the 'toolbar' option to "no".
var ref = window.open('http://apache.org', '_blank', 'toolbar=no');
However, removing the toolbar means both the 'Back/Forward' buttons and the 'Done' button will no longer show. This makes it difficult to exit out of the InAppBrowser.
If you want to keep the 'Done' button, but get rid of the 'Back/Forward' buttons in all of your InAppBrowsers, you can modify the source code for the InAppBrowser plugin as follows.
For iOS, open the following file
YOURAPPNAME/platforms/ios/YOURAPPNAME/Plugins/org.apache.cordova.inappbrowser/src/ios/CDVInAppBrowser.m
and change the following line of code from:
[self.toolbar setItems:@[self.closeButton, flexibleSpaceButton, self.backButton, fixedSpaceButton, self.forwardButton]];
to:
[self.toolbar setItems:@[self.closeButton, flexibleSpaceButton]];
Then build your project again using the command line.
InAppBrowser官网详解:
http://cordova.apache.org/docs/en/3.3.0/cordova_inappbrowser_inappbrowser.md.html
- 大小: 94.3 KB
分享到:
相关推荐
AppVeyor 特拉维斯CI科尔多瓦插件的浏览器您可以在应用程序内显示有用的文章,视频和网络资源。 用户无需离开您的应用程序即可查看网页。 要获得一些想法,请查看本页底部的或直接转到内容。 该插件提供了一个Web...
该插件提供了在调用cordova.InAppBrowser.open()时显示的Web浏览器视图。 var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', 'location=yes'); cordova.InAppBrowser.open()函数被定义为...
cordova-plugin-inappbrowser 此插件提供了在调用cordova.InAppBrowser.open()时显示的 Web 浏览器视图。 var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', 'location=yes');cordova....
插件调用都只能调用本地的html,这个功能就是为了Cordova能调用远程的HTML页面,这样的话,一些逻辑可以放在服务器上,不需要全部打包放在app中,同时远程的html可以调用插件,调用方式同一般的cordova插件。
cordova-screenshot cordova截屏插件 document.addEventListener("deviceready", init, false); function init() { document.querySelector("#share").addEventListener("touchend", function() { navigator....
Android Cordova 插件开发之编写自定义插件源码
Cordova插件-用于播放海康监控视频
> 此实例代码为 Android Studio 原生项目集成 Cordova 插件演示,而非通过 Cordova 直接编译,方便您在现有 Android Studio 项目中集成 Cordova 进行 H5 混合开发。 为了结构清晰及易维护性,项目分三个 Module ,...
自定义Cordova插件,开源的插件不满足需求时,可以自己开发自己的插件
百度地图定位Cordova插件,支持Android,IOS 可以在此地址查看example 基于百度地图Android版定位SDK(v7.1)以及百度地图IOS SDK (v3.2.1) 一,申请Android及IOS版密钥 申请密钥Android定位SDK 每一个...
ionic工程已经安装好插件
com.neka.cordova.inappbrowser 具有更多可配置选项的 Cordova InAppBrowser 版本。
科尔多瓦插件的浏览器该插件提供了在调用cordova.InAppBrowser.open()时显示的Web浏览器视图。 var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', 'location=yes');cordova.InAppBrowser.open()...
phonegap/Cordova和android自定义插件模块,cordova build后插件不会消失
该插件提供了一个Web浏览器视图,该视图在调用cordova.InAppBrowser.open()时显示。 var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', 'location=yes'); window.open cordova.InAppBrowser....
Custom-URL-scheme, 通过定制的URL方案启动 cordova/phonegap应用程序,如 mycoolapp 使用以下链接启动你的应用程序:/phonegap插件插件: mycoolapp:// 描述安装工具自动( cli/plugman )手动加载 PhoneGap构建插件...
该资源是我学习使用Cordova自定义插件的完整源码,里面包含创建cordova项目,自定义插件等
cordova开发的APP,需要在图标上显示通知数量的插件。
cordova自定义插件,js代码与原始交互的通道
自定义cordova插件,添加到项目中使用(含参考链接,可自己学习)