egret noBorder模式下全屏scrollview的设置

由于noBorder模式下有裁切,所以如果设置滚动视图的高为stageH的话会导致底部的内容拉不上来。

//设置滚动的宽高以及位置 

  this.canvas_top = window["$"]("canvas")[0].style.top.split("px")[0] - 0; //canvas偏移量

let _precnet = 375 / document.body.clientWidth;

this.case_scrollview.width = this.stage.stageWidth;

//高度设置为可视区域的高

this.case_scrollview.height = this.stage.stageHeight  + this.canvas_top * 4 * _precnet;

this.case_scrollview.y = -(this.canvas_top * 2 * _precnet);  //滚动视图偏移 补掉被裁切的部分

猜你喜欢

转载自blog.csdn.net/qq_32307891/article/details/90291198
今日推荐