uni-app页面导航栏透明背景
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
uni-app页⾯导航栏透明背景效果:
代码:
// pages.json ,需要的页⾯添加
{
"path": "pages/ServiceHome/ServiceHome",
"style": {
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "transparent",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"type": "float",
"titleText": "uni-app"
}
}
}
},
<template>
<view class="home-container">
<view class="home-top">
<image class="bg" src="../../static/icon/bg.jpeg"></image>
</view>
</view>
</template>
<script>
</script>
<style lang="scss" scoped>
.home-container{
min-height: 100vh;
.home-top{
position: relative;
width: 100vw;
height: 500rpx;
background-color: #007AFF;
.bg{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
}
</style>
2021.2.15更,以上⽅法iOS机型没问题,Android不⽣效
改如下即可
{
"path": "pages/PersonCenter/Login",
"style": {
"navigationBarBackgroundColor": "transparent",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": false
}
}
},。