前端技术博客-pdfh5.js

  • 首页
  • 分类
  • 文章归档
  • 友情链接
  • 关于我

  • 搜索
canvas react vue 随笔 SVG GitHub pdf.js tomcat nginx uniapp Linux javascript ES6 pdfh5

uniapp动态修改原生标题栏按钮webview样式等

发表于 2019-11-15 | 分类于 前端 | 0 | 阅读次数 2988
// #ifdef APP-PLUS
var currentWebview = this.$mp.page.$getAppWebview();
var tn = currentWebview.getStyle().titleNView;
tn.buttons[1].text = this.cancelFlag ? "完成":"编辑";
currentWebview.setStyle({
titleNView: tn
});
// #endif

原生view的样式参考http://www.html5plus.org/doc/zh_cn/nativeobj.html#plus.nativeObj.ViewStyles

this.currentWebview = this.$mp.page.$getAppWebview();
this.titleNView = this.currentWebview.getTitleNView();
let currentWebview = plus.webview.currentWebview(); //获取当前页面的webview对象
this.currentWebview = currentWebview;
// this.webview = currentWebview.children()[0];
this.webview = plus.webview.create('/hybrid/html/index.html?app=true', 'custom-webview', {
top: 0 ,//放置在titleNView下方。如果还想在webview上方加个地址栏的什么的,可以继续降低TOP值
cachemode:"cacheElseNetwork",//只要存在缓存(即使过期)数据则使用,否则从网络获取
hardwareAccelerated:true,//开启硬件加速
kernel:"WKWebview",//使用WKWebview内核
popGesture:"none"
});
this.currentWebview.append(this.webview);

let currentWebview = plus.webview.currentWebview(); //获取当前页面的webview对象
this.currentWebview = currentWebview;
// this.webview = currentWebview.children()[0];
this.webview = plus.webview.create('/hybrid/html/index.html?app=true', 'custom-webview', {
top: 0 ,//放置在titleNView下方。如果还想在webview上方加个地址栏的什么的,可以继续降低TOP值
cachemode:"cacheElseNetwork",//只要存在缓存(即使过期)数据则使用,否则从网络获取
hardwareAccelerated:true,//开启硬件加速
kernel:"WKWebview",//使用WKWebview内核
popGesture:"none"
});
this.currentWebview.append(this.webview);
Donate comment here
pdfh5.js 微信支付

微信支付

pdfh5.js 支付宝

支付宝

  • 本文作者: pdfh5.js
  • 本文链接: https://www.gjtool.cn/archives/uniapp动态修改原生标题栏按钮webview样式等
  • 版权声明: 本博客所有文章除特别声明外,均采用CC BY-NC-SA 3.0 许可协议。转载请注明出处!
# uniapp
前端html第三方登录集合微信微博QQ
uniapp安卓离线打包配置官方插件原生插件
  • 文章目录
  • 站点概览
pdfh5.js

pdfh5.js

时间扑面而来,而我们终将释怀

21 日志
6 分类
14 标签
RSS
Github
Creative Commons
Links
  • Halo社区
0%
© 2018 — 2022 前端技术博客-pdfh5.js
鄂ICP备19002193号 鄂公网安备 42112602000235号