var length = Math.ceil(boxProducts.length / 2);
var yGap = 10;
var itemHeight = this._itemWidget.getContentSize().height;
var totalHeight = yGap * (length - 1) + itemHeight * length;
var innerSize = this._ScrollView.getInnerContainerSize();
totalHeight = Math.max(this._ScrollView.getContentSize().height, totalHeight);
var height = this._ScrollView.getContentSize().height;
if(height < totalHeight){
this._ScrollView.setBounceEnabled(true);
}
this._ScrollView.setInnerContainerSize(cc.size(innerSize.width, totalHeight));
//x坐标起始
var xStart = 120;
//y坐标起始
// var yStart = 300;
var yStart = totalHeight - itemHeight / 2;
ScrollView 总结
最新推荐文章于 2022-06-09 13:42:17 发布