方法1:在pages.json
{
...
"pages": [
{
"path": "XXXX",
"style": {
"navigationBarTitleText": "導(dǎo)航欄",
"navigationStyle": "custom" // 使用自定義導(dǎo)航欄,系統(tǒng)會關(guān)閉默認(rèn)的原生導(dǎo)航欄
}
},
...
]
...
}
原生小程序也可以采用類似的方法去掉頂部,讓頭部變透明
小程序頁面頂部導(dǎo)航欄navigationBar如何隱藏、變透明?_你摯愛的強(qiáng)哥的博客-CSDN博客小程序頂部的白色背景條就不見了,直接變透明,只剩下右上角的膠囊按鈕。https://s-z-q.blog.csdn.net/article/details/131637783?
方法2:在pages.json
{
...
"pages": [
{
"path": "XXXX",
"style": {
"navigationBarTitleText": "導(dǎo)航欄",
"app-plus": {
"titleNView": false //禁用原生導(dǎo)航欄
}
}
},
...
]
...
}
方法3:用css隱藏
/* #ifdef H5 */
uni-page-head {
display: none;
}
/* #endif */
如果要禁用所有頁面的導(dǎo)航欄?
文章來源:http://www.zghlxwxcb.cn/news/detail-536129.html
在pages.json文章來源地址http://www.zghlxwxcb.cn/news/detail-536129.html
{
...
"globalStyle": {
"app-plus": {
"titleNView": false //禁用原生導(dǎo)航欄
},
...
},
...
}
到了這里,關(guān)于uniapp開發(fā)小程序H5頁面頂部導(dǎo)航欄navigationBar如何隱藏?三種解決辦法的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!