美文网首页
动态计算view高度

动态计算view高度

作者: 廷裕同学 | 来源:发表于2022-07-12 14:41 被阅读0次
    // 动态计算滚动区域高度
        computeScrollViewHeight(){
            let that = this;
            let query = wx.createSelectorQuery().in(this);
            
            query.select('.topmenu').boundingClientRect(function(res){
                let headHight = res.height;
                let screeHeight = wx.getSystemInfoSync().windowHeight;
                let scrollHeight = screeHeight - headHight;
                that.setData({
                    scrollViewHeight:scrollHeight
                });
            }).exec();
        }
    

    相关文章

      网友评论

          本文标题:动态计算view高度

          本文链接:https://www.haomeiwen.com/subject/jekabrtx.html