[LayaAir 1.0]LIST renderHandler的ITEM高度自定义后,设置content变更其内部容器大小不生效

ViewActivityLimitedTask.prototype.initComp = function() {
this.list_view.vScrollBarSkin = "";
this.list_view.scrollBar.elasticBackTime = ListConst.elasticBackTime;
this.list_view.scrollBar.elasticDistance = ListConst.elasticDistance;
this.list_view.renderHandler = new Laya.Handler(this, this.onItemUpdate);
this.list_view.mouseHandler = new Laya.Handler(this, this.onItemClick);
this.list_view.array = ;// 这里必须要初始化数据
}
 
ViewActivityLimitedTask.prototype.onItemUpdate = function(_cell, _index) {
    var data = this.mList_.task_info[_index];
    if (data) {
        _cell.layer_one.visible = (-1 == data.task_id);
        _cell.layer_two.visible = !_cell.layer_one.visible;
        _cell.height = (-1 == data.task_id ? 80 : 152);

        if (0 == data.my_index) {// my_index是代码是自定义的下标值
            _cell.y = 0;
        } else if (1 == data.my_index) {
            _cell.y = 80 + 10;    
        } else {
            _cell.y = (data.my_index - 1) * 152 + data.my_index * 10 + 80;
        }
    }
}
 
this.list_view.array = this.mList_.task_info;// 更新数据源
// this.list_view.content.height = (this.mList_.task_info.length - 1) * 152 + 80 + (this.mList_.task_info.length - 1) * 10;// 动态改变大小
上面这段代码不生效。
 
QQ20191111-165355.png QQ20191111-165317.png QQ20191111-170542.png
已邀请:

Aar0n

赞同来自:

看不到demo,请上传demo

159*****407

赞同来自:

Laya_Aaron 你好 附件已经上传

要回复问题请先

商务合作
商务合作