CocoStudio of UIPanel.addChild increase cc.TableView bug?


#1

With Javascript/Web project this code will work:
@
var Panel_tactics = ccs.UIHelper.seekWidgetByName(this._widget, “Panel_tactics”);
var tableView = cc.TableView.create(this, Panel_tactics.getSize());
tableView.setDirection(cc.SCROLLVIEW_DIRECTION_VERTICAL);
tableView.setPosition(Panel_tactics.getPosition());
tableView.setDelegate(this);
Panel_tactics.addChild(tableView);@

cocos2d-html5 error:
Panel_tactics.addChild(tableView); —> Uncaught TypeError: Object # has no method ‘getLayoutParameter’ ;


#2

UIPanel can only add add ui component as child, such as uilabel and uibutton.


#3

UIPanel 如果要添加cc.tableView, 没有其它解决方案?


#4

Try:

var MyLayer = cc.Layer.extend({
    uLayer:null,
    init:function(){
        uLayer = new ccs.UILayer(); //for uilayer
        this.addChild(table);
    }
});

please in english next time.


#5

我知道原因了:
The addChild method of ccs.Widget can only add widget,
use addNode to add a cc.Node subclass object,like:
谢谢大神回答!!!!


应该在 2.2.2 版本可以使用 addNode 方法增加 cc.tableView


#6

you are welcome! please write in english next time.