page.json 配置
加 “app-plus”: {
“softinputMode”: “adjustResize”
}
{
"path": "pages/jxx/xx",
"style": {
"navigationBarTitleText": "贺卡DIY",
"enablePullDownRefresh": false,
"app-plus": {
"softinputMode": "adjustResize"
}
}
},
背景图不要设置成高100%,获取窗口高度给背景图高赋值。
<view class="bgbg" :style="{height: screenHeight == 0 ? '100%':screenHeight+'px'}"></view>
created() {
this.screenHeight = uni.getSystemInfoSync().windowHeight;
},
ok完美解决。