小程序
小游戏
企业微信
微信支付
扫描小程序码分享
会导致页面的列表数据无法全部显示出来
4 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
用 flex 布局啊
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
onShow():void { const info = wx.getSystemInfoSync() const { screenHeight } = info const c = screenHeight / 667 this.setData({ scrollViewHeight: 1080 * c, }) }
第一计算屏幕的高度,动态设置高度;第二设置scroll-y="true",可以上下滑动
计算屏幕需要区域的高度 然后动态给scroll-view设置高度就可以了
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
用 flex 布局啊
onShow():void { const info = wx.getSystemInfoSync() const { screenHeight } = info const c = screenHeight / 667 this.setData({ scrollViewHeight: 1080 * c, }) }
第一计算屏幕的高度,动态设置高度;第二设置scroll-y="true",可以上下滑动
计算屏幕需要区域的高度 然后动态给scroll-view设置高度就可以了
加载小程序获取屏幕高度,然后就计算你们想要的区域 动态设置就可以
wx.getSystemInfo({
success: function(res) {
this_.globalData.winWidth = res.screenWidth;
this_.globalData.winHeight = res.screenHeight;
}
});
那个页面使用就取屏幕高度(app.globalData.winHeight)计算比例 算出想要的区域高度
wxml 动态设置即可<scroll-view scroll-y="true" style="height: {{winHeight}}px";>