LuaQuick框架(客户端)

996传奇引擎三端lua快速开发


表容器(TableView)

<p>[TOC]</p> <h3>创建列表容器[优化加载]</h3> <pre><code>co.TableView:create(parent, id, x, y, width, height, direction, cellWid, cellHei, num)</code></pre> <pre><code>parent     父节点对象 id         唯一ID x          位置 横坐标 y          位置 纵坐标 width      容器宽度 height     容器高度 direction  方向 [1.垂直; 2.水平] cellWid    单个cell 宽 cellHei    单个cell 高 num        需创建cell个数</code></pre> <h3>设置子cell创建方法</h3> <pre><code>co.TableView:setCell(widget, callback)</code></pre> <pre><code>widget   TableView对象 callback 创建函数 传入参数(cell父节点, cell下标)</code></pre> <h3>设置滚动方向</h3> <pre><code>co.TableView:setDirection(widget, type)</code></pre> <pre><code>widget TableView对象 type   滚动方向 [1.垂直; 2.水平]</code></pre> <h3>设置背景颜色</h3> <pre><code>co.TableView:setBackGroundColor(widget, color)</code></pre> <pre><code>widget TableView对象 color  十六进制颜色值 例:&amp;quot;#FFFFFF&amp;quot;</code></pre> <h3>设置内部区域偏移位置[3.40.3版本]</h3> <pre><code>co.TableView:setContentOffset(widget, x, y)</code></pre> <pre><code>widget TableView对象 x      偏移坐标X y      偏移坐标Y</code></pre> <h3>设置内部区域偏移位置[3.40.3版本]</h3> <pre><code>co.TableView:getContentOffset(widget, x, y)</code></pre> <h3>添加点击cell事件</h3> <pre><code>co.TableView:addClickEventListener(widget, callback)</code></pre> <h3>滚动到某cell位置</h3> <pre><code>co.TableView:scrollToCell(widget, index)</code></pre> <pre><code>widget TableView对象 index  对应cell下标</code></pre> <h3>添加容器滚动回调[3.40.3版本]</h3> <pre><code>co.TableView:addScrollEventListener(widget, func)</code></pre> <pre><code>widget TableView对象 func   容器滚动回调函数 param1: TableView控件</code></pre> <h3>设置容器cell个数[3.40.5版本]</h3> <pre><code>co.TableView:setTableViewCellCount(widget, func)</code></pre> <pre><code>widget TableView对象 func   cell总个数(int)/返回cell总个数的函数(func)</code></pre> <h3>加载容器所有列表数据 [3.40.5版本]</h3> <pre><code>co.TableView:reloadData(widget)</code></pre> <h3>添加容器鼠标滚动事件 [3.40.5版本]</h3> <pre><code>co.TableView:addMouseScrollEventListener(widget, func)</code></pre> <pre><code>widget TableView对象 func   鼠标滚动回调函数传参{widget = widget, x = 滚动坐标X, y = 滚动坐标Y} [不填采用官方默认添加滚动]</code></pre> <h3>获取容器cell的下标/序列号</h3> <pre><code>co.TableView:getIndex()</code></pre> <pre><code>widget TableView对象</code></pre>

页面列表

ITEM_HTML