细嗅蔷薇
细嗅蔷薇
  • 发布:2021-01-16 16:20
  • 更新:2022-11-25 09:58
  • 阅读:5539

uni-app动态隐藏导航栏按钮button教程

分类:uni-app

uni-app动态隐藏导航栏按钮button教程:

代码如下:

var webView = this.$mp.page.$getAppWebview();  
webView.setTitleNViewButtonStyle(0,{  
    width: '0'  
});  
webView.setTitleNViewButtonStyle(1,{  
    width: '0'  
});
0 关注 分享

要回复文章请先登录注册

1***@qq.com

1***@qq.com

回复 治电小白菜 :
Cannot read property 'page' of undefined,有报错哎
2022-11-25 09:58
治电小白菜

治电小白菜

```js
// #ifdef H5
document.querySelector('.uni-page-head-ft .uni-page-head-btn').style.display = 'none'
// #endif
// #ifdef APP
const webView = this.$mp.page.$getAppWebview();
webView.setTitleNViewButtonStyle(0,{
width: '0'
});
webView.setTitleNViewButtonStyle(1,{
width: '0'
});
// #endif
```
2022-11-01 11:09
治电小白菜

治电小白菜

回复 1***@qq.com :
这个是给app用的
2022-11-01 11:08
1***@qq.com

1***@qq.com

加了没用
2021-05-13 10:28