Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 表情符号在CCLabelTTF中单调_Ios_Objective C_Cocos2d Iphone_Emoji_Cclabelttf - Fatal编程技术网

Ios 表情符号在CCLabelTTF中单调

Ios 表情符号在CCLabelTTF中单调,ios,objective-c,cocos2d-iphone,emoji,cclabelttf,Ios,Objective C,Cocos2d Iphone,Emoji,Cclabelttf,我正在objective-c中使用cocos2d iphone 当我使用CCLabelTTF显示文本时,如果文本中有表情符号,它们也会按照文本的颜色着色,这不是我想要的 然而,当我使用UITextView时,表情是好的。不管我用什么颜色,我都会按代码设置 @property (nonatomic, readwrite, strong) UITextView *someTextView; SomeTextView.textColor = [UIColor redColor]; 表情符号仍然是正常

我正在objective-c中使用cocos2d iphone

当我使用CCLabelTTF显示文本时,如果文本中有表情符号,它们也会按照文本的颜色着色,这不是我想要的

然而,当我使用UITextView时,表情是好的。不管我用什么颜色,我都会按代码设置

@property (nonatomic, readwrite, strong) UITextView *someTextView;
SomeTextView.textColor = [UIColor redColor];
表情符号仍然是正常的颜色(本例中不是红色)


然而,我已经有很多代码使用CCLabelTTF,更改为UITextView太难了。有人知道如何在CCLabelTTF中解决这个问题吗?

C不是客观的-C不是C!对此不确定,但我认为您可以使用NSAttributed字符串初始化CCLabelTTF。。。这可能有更好的机会尊重内部文本片段的表情细节。只是一个想法。谢谢!但是你怎么能用NSAttributed字符串初始化CCLabelTTF呢。。。直接从.h文件:
+(id)labelWithAttributedString:(NSAttributedString*)attrString