cordova-plugin-themeablebrowser插件使用整理
来源:互联网 发布:定居中国的外国人知乎 编辑:程序博客网 时间:2024/04/29 18:53
一、ThemeableBrowser插件整理
Git源代码+Api地址:https://github.com/initialxy/cordova-plugin-themeablebrowser
命令:
cordova plugin add cordova-plugin-themeablebrowser
说明:
1.此插件可以实现独立窗口打开页面,但是全屏设置好像没有起作用
2.此插件可以配置标题栏、关闭按钮、分享按钮,菜单按钮等
3.此插件依赖InAppBrowser
二、VS中使用步骤
1. 添加插件
2.手动Copy对应平台的图片,以Android为例
三、使用实例
示例1:官方demo
$scope.show = function () { //官方实例 cordova.ThemeableBrowser.open('http://www.gongjuji.net', '_blank', { statusbar: { color: '#00000000' }, toolbar: { height: 44, color: '#f0f0f0ff' }, title: { color: '#ff000000', showPageTitle: true, staticText: '微工具集首页' }, backButton: { image: 'back', imagePressed: 'back_pressed', align: 'left', event: 'backPressed' }, forwardButton: { image: 'forward', imagePressed: 'forward_pressed', align: 'left', event: 'forwardPressed' }, closeButton: { image: 'close', imagePressed: 'close_pressed', align: 'left', event: 'closePressed' }, customButtons: [ { image: 'share', imagePressed: 'share_pressed', align: 'right', event: 'sharePressed' } ], menu: { image: 'menu', imagePressed: 'menu_pressed', title: 'Test', cancel: 'Cancel', align: 'right', items: [ { event: 'helloPressed', label: 'Hello World!' }, { event: 'testPressed', label: 'Test!' } ] }, backButtonCanClose: true }).addEventListener('backPressed', function (e) { alert('back pressed'); }).addEventListener('helloPressed', function (e) { alert('hello pressed'); }).addEventListener('sharePressed', function (e) { alert(e.url); }).addEventListener(cordova.ThemeableBrowser.EVT_ERR, function (e) { console.error(e.message); }).addEventListener(cordova.ThemeableBrowser.EVT_WRN, function (e) { console.log(e.message); });}
示例2:
//窗口2 修改地址栏和关闭按钮$scope.show2 = function () { var ref = cordova.ThemeableBrowser.open('http://www.baidu.com', '_blank', { title: { color: '#000000', showPageTitle: true, staticText: '微工具集首页' }, closeButton: { image: 'back', imagePressed: 'back_pressed', align: 'left', event: 'backPressed' }, toolbar: { height: 44, color: '#387EF5' } });}
更多:
Ionic 中使用iframe嵌入外网页面整理
Cordova 配置WebView可以打开外部链接
cordova-plugin-inappbrowser插件使用整理
0 0
- cordova-plugin-themeablebrowser插件使用整理
- cordova-plugin-inappbrowser插件使用整理
- cordova-plugin-console插件及Cordova Web页面调试整理
- cordova-plugin-wechat插件的使用
- cordova-plugin-app-version插件的使用
- Cordova使用插件cordova-plugin-media-capture调用摄像头
- cordova wifi插件(cordova plugin add cordova-plugin-hotspot)
- cordova-plugin-splashscreen插件使用时显示OOM
- cordova插件-motorola-datawedge-cordova-plugin
- Cordova 插件开发(plugin)
- Cordova-----3、Cordova使用插件
- cordova-plugin-device 获取设备信息整理
- cordova-plugin-vibration 设备震动整理
- cordova-plugin-statusbar状态栏设置整理
- cordova-plugin-geolocation设备地理位置整理
- Cordova 开发属于自己的插件(plugin
- Cordova插件之支付整理
- Cordova:插件测试小结-cordova-plugin-test-framework
- js引号的多层嵌套
- 浮点数中的陷进
- Oracle一次断电后重启无法登陆数据库
- JQuery字符串替换replace方法
- css/html 打字机效果输出文字
- cordova-plugin-themeablebrowser插件使用整理
- LintCode Kth Smallest Number in A Unsorted Array
- 【GDOI2017模拟2.14】A
- linux yum安装lsof命令
- 对$.post跟$.get重新封装,将签名和时间戳传递到Header中
- PLSQL快捷键
- SQL基础知识
- 安装hadoop集群(三台REDHAT虚拟机)
- 跟我学STM32107RC--- STM32中的蜂鸣器实验总结