首页 > 其他 > 详细

动态设置WX滚动条的高度(非常重要)

时间:2019-07-12 12:07:45      阅读:115      评论:0      收藏:0      [点我收藏+]
wxml:
<scroll-view class="scroll" scroll-y="true" style="height:{{clientHeight?clientHeight+‘px‘:‘auto‘}}">
js:
onShow: function (options) {
 

wx.setNavigationBarTitle({
title: options.title
});

var that = this;//用在wx的API中要用that不能用this
wx.getSystemInfo({
success: function (res) {
var height = res.windowHeight-46;//1rpx=0.5px
console.log(height);
that.setData({
clientHeight: height
})


}
});

 
},

动态设置WX滚动条的高度(非常重要)

原文:https://www.cnblogs.com/bwdblogs/p/11175100.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!