const ListViewAdapter = require('../utils/TapTapScrollViewAdapter'); cc.Class({ extends: cc.Component, properties: { content: cc.Node, item: cc.Prefab, }, // LIFE-CYCLE CALLBACKS: // onLoad () {}, start () { }, init() { if (this.listAdapter === undefined || this.listAdapter === null) { this.listAdapter = new ListViewAdapter(this); this.listAdapter.spacing = 14; } let data = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]; this.listAdapter.updateItems(data, this.item, 'GameFriendItem'); }, onScroll() { if (this.listAdapter != undefined) { this.listAdapter.update(); } }, // update (dt) {}, });