版本号:1.4.0.1
button 调用setTitleText方法报错···
auto layer = GUIReader::getInstance() -> widgetFromJsonFile(“PlayPage.json”);
this -> addChild(layer,0);
Button* currentBtn =(Button*) layer->getChildByName(“btnList”)->getChildByName(“currentL”);
currentBtn->setTitleText(Value(5).asString());
代码执行到这里就报错了···原因是_titleRenderer这个东西是NULL。所有跟title相关的方法都报错···原因都一样···
我试过了手动创建的Button控件能正常使用···但是通过cocostudio获取到的button就要报错···
Button* btn=Button::create("");
btn->setTitleText("");
向上面手动创建的···就不会报错··求解···