app-plus配置如下,targetSdkVersion为35:
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"safearea" : {
"background" : "#fff7ed",
"bottom" : {
"offset" : "none"
}
},
"distribute" : {
"android" : {
"packagename" : "...",
"permissions" : [...],
"abiFilters" : [ "arm64-v8a" ],
"targetSdkVersion" : 35
}
}
}
首页相关代码,页面也都使用了env(safe-area-inset-bottom) 来处理安全区:
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{title}}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
.content {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: aquamarine;
box-sizing: border-box;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>