请教下,富文本控件怎么用,我创建了一个图片的元素,但是在添加的时候报错了,Uncaught TypeError: Cannot read property ‘_type’ of undefined
var richText = new ccui.RichText();
richText.ignoreContentAdaptWithSize(false);
richText.width = 300;
richText.height = 400;
richText.setPosition(cc.p(500, 300));
this.addChild(richText);
var img = ccui.RichElementImage(3, cc.color.WHITE, 255, res.img);
richText.pushBackElement(img);
这样写不对么?