jsbLabel.prototype.setLineHeight = function (height) {
if (this._labelType !== _ccsg.Label.Type.SystemFont) {
this._setLineHeight(height);
}
else {
// Todo support setLineHeight for Native
if (40 !== height) {
cc.warnID(4013);
}
}
};
其中 _ccsg.Label.Type.SystemFont == 2,
void Label::setLineHeight(float height)
{
CCASSERT(_currentLabelType != LabelType::STRING_TEXTURE, “Not supported system font!”);
if (_lineHeight != height)
{
_lineHeight = height;
_contentDirty = true;
}
}
LabelType::STRING_TEXTURE == 3,
调用setLineHeight在IOS中会闪退, 请问JS中如何获取 label的 _LebelType ,我们自己做类型判断。
引擎:1.10.1