TableView

tableView = cc.TableView:create(cc.size(810, 440))
tableView:setDirection(cc.SCROLLVIEW_DIRECTION_VERTICAL)
tableView:setVerticalFillOrder(cc.TABLEVIEW_FILL_TOPDOWN)
tableView:setColor(cc.c3b(255,255,255))
tableView:setPosition(cc.p(10, 10))
tableView:setDelegate()
imgBk:addChild(tableView)
tableView:registerScriptHandler(function(tableView)
    return 1
end, cc.NUMBER_OF_CELLS_IN_TABLEVIEW)  


tableView:registerScriptHandler(function(tableView, idx)
    return 960, 640
end, cc.TABLECELL_SIZE_FOR_INDEX)


tableView:registerScriptHandler(function(tableView, idx)
    local pDelCell = tableView:dequeueCell()
    while (pDelCell ~= nil) do
        pDelCell:removeAllChildren()
        pDelCell:removeFromParent()
        pDelCell = tableView:dequeueCell()
    end
    local cell = tableView:dequeueCell()
    if cell == nil then
        cell = cc.TableViewCell:create()
        local cellBg = ccui.ImageView:create("ac_bk.png", 1)
        cellBg:setPosition(cc.p(cellWidth / 2.0, cellHeight / 2.0 + 5))
        cellBg:setScale9Enabled(true)
        cellBg:setContentSize(cc.size(cellWidth  - 10,90))
        cell:addChild(cellBg)     
    end
    return cell
end, cc.TABLECELL_SIZE_AT_INDEX) 
tableView:reloadData()




-- tableView:registerScriptHandler(CueResultLayer.scrollViewDidScroll,cc.SCROLLVIEW_SCRIPT_SCROLL)
-- tableView:registerScriptHandler(CueResultLayer.scrollViewDidZoom,cc.SCROLLVIEW_SCRIPT_ZOOM)
-- tableView:registerScriptHandler(CueResultLayer.tableCellTouched,cc.TABLECELL_TOUCHED)
-- tableView:registerScriptHandler(CueResultLayer.cellSizeForTable,cc.TABLECELL_SIZE_FOR_INDEX)
-- tableView:registerScriptHandler(CueResultLayer.tableCellAtIndex,cc.TABLECELL_SIZE_AT_INDEX)
-- tableView:registerScriptHandler(CueResultLayer.numberOfCellsInTableView,cc.NUMBER_OF_CELLS_IN_TABLEVIEW)
-- function CueResultLayer.scrollViewDidScroll(view)
-- end


-- function CueResultLayer.scrollViewDidZoom(view)
-- end


-- function CueResultLayer.tableCellTouched(table,cell)
-- end


-- function CueResultLayer.cellSizeForTable(table,idx) 
--     return 960,640
-- end


-- function CueResultLayer.tableCellAtIndex(table, idx)
    
--     local cell = table:dequeueCell()
--     while ( cell ~= nil ) do
--        cell:removeFromParent()
--        cell = table:dequeueCell()
--     end
   
--     if nil == cell then
--         cell = cc.TableViewCell:new()


--         local propId, propgrade = CueResultLayer:analysisInfo(CueResultLayer.reslutList[idx + 1])




--         local cellBg = ccui.Scale9Sprite:createWithSpriteFrameName("Gray_Bg.png")
--         cellBg:setContentSize(cc.size(CELL_WIDTH, CueResultLayer._cellHeight[idx]))
--         cellBg:setPosition(cc.p(CELL_WIDTH/2, CueResultLayer._cellHeight[idx] / 2))
--         cell:addChild(cellBg)
--     end


--     return cell
-- end


-- function CueResultLayer.numberOfCellsInTableView(table)
--    return 1
-- end
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值