• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 353 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0065 秒)

21. list的selectHandler属性连续点击同一个item不能重复接收事件 [ 93%]

...      list.selectEnable = true;     list.selectHandler = new Handler(this, onSelect);        function onSelect(index)     {         alert("当前选择的索引:" + index);     }      第一次点击时有事件响应:       再次点击(不要点击其它的列表)...

来源: Laya_社区 发布时间: 20180507

22. 为什么list不能滑动,怎么让list滑动 [ 93%]

...:必须是类,不能是实例化对象,Item需类继承于Box) // this.gradeList.vScrollBarSkin = ""; this.gradeList.itemRender = GradeItem; //列表显示区单元格的列数 this.gradeList.repeatX = 5; //列表显示区单元格的行数 this.gradeList.repeatY = 10;  this.gradeList.space...

来源: Laya_社区 发布时间: 20190515

23. List组件拖动浏览时item会出现重叠的现象 [ 92%]

...可做的操作 list.selectEnable = true; list.selectHandler = new Handler(this, this.onSelect); // 滚动条的橡皮筋操作:回弹时间及弹性距离 list.scrollBar.elasticBackTime = 200; list.scrollBar.elasticDistance = 5; Laya.stage.addChild(list); // 设置数据项为对应图片的路...

来源: Laya_社区 发布时间: 20180410

24. UI 组件中list自动滚动到list底部或者顶部 [ 92%]

...片段 MyChat.prototype.ScrollToBottom=function(caller,callback){ var page=this.msgList.length - 8; if(page < 0)page=0; page +=1; if(caller) this.list.tweenTo(page,0,Handler.create(caller,callback)); else this.list.tweenTo(page,0); } 2019-02-26 添加评论 免费帖 --> 分享 微博 QZONE 微...

来源: Laya_社区 发布时间: 20190226

25. 自定义渲染后,customRender里设置uniform值在ui节点下不生效 [ 92%]

...ext:Laya.RenderContext,x:number,y:number):void{             if(this.shader._program)             {                 let u_lightTime = gl.getUniformLocation(this.shader._program, "u_lightTime")                 gl.uniform1f(u_lightTime, this.timer...

来源: Laya_社区 发布时间: 20181121

26. List的selectHandler 点击同一个item只能触发一次回调 [ 92%]

...dz5566 • 2019-03-06 23:14 laya.ui.js改成这样即可,去掉判断if (this._selectedIndex !=value) __getset(0,__proto,'selectedIndex',function(){ return this._selectedIndex; },function(value){ //if (this._selectedIndex !=value){ this._selectedIndex=value; this.changeSelectStatus(); this.event(/...

来源: Laya_社区 发布时间: 20190305

27. list中加的button不能接收点击事件 求一个list中加button的demo [ 91%]

...  }         let list = new Laya.List;         list.width = this.itemList.width;         list.height = this.itemList.height;         list.x = this.itemList.x;         list.y = this.itemList.y;         list.spaceY = 12;         list.vScrollBarSkin = ""...

来源: Laya_社区 发布时间: 20170310

28. Laya.timer.loop() 报错 Cannot read property 'loop' of null [ 91%]

...umber = 0; private y0:number = 0; constructor(){super();} onEnable():void{ this.x = this.x0; this.y = this.y0; Laya.timer.loop(20, this, this.frameWork); // 每 20 ms 执行一次 } private frameWork():void{ this.y = this.y0 + 10 * (this.n % 3); alert("move "); } }代码放在一个 Image 组件的 ...

来源: Laya_社区 发布时间: 20200203

29. [LayaAir3]list.selectHandler [ 91%]

...选择的索引:" + index);         let checkBoxItem:Laya.CheckBox = this._list.getChildAt(index).getChildAt(0) as Laya.CheckBox;         if(checkBoxItem!=null){                         switch(checkBoxItem.name.trim()){                 case "0":{                ...

来源: Laya_社区 发布时间: 20241014

30. 分享:List相关(Item增删功能) [ 90%]

...er.load([{url: "res/atlas/comp.json", type: Loader.ATLAS}], Handler.create(this, onLoaded)); } private function onLoaded():void { //实例UI界面 listP = new ListPageUI(); Laya.stage.addChild(listP); Laya.timer.once(1000,this,onAdd);//1000毫秒后初始化list数据 listP.add.on(Event.CLICK,this,o...

来源: Laya_社区 发布时间: 20170313