SKLabelNode creates black line and not showing text on iPhone4

筅森魡賤 提交于 2019-12-13 20:23:33

问题


I am loading different texts into a SKLabeNode it works fine on iPhone5, simulator, etc... but on iPhone4 I sometimes just get a black line, instead of the text.

It is weird that always the same texts are generating the failure, but I cannot figure out what is happening.

The code is:

ButtonText=@"";

    ButtonLabel=[SKLabelNode labelNodeWithFontNamed:@"Marker Felt"];
    ButtonLabel.fontSize=46;
    ButtonLabel.text=ButtonText;
    ButtonLabel.position=CGPointMake(0, 0);
    ButtonLabel.verticalAlignmentMode=SKLabelVerticalAlignmentModeCenter;
    ButtonLabel.horizontalAlignmentMode=SKLabelHorizontalAlignmentModeCenter;
    ButtonLabel.colorBlendFactor=1.0f;

When I am changing the text, simply using the

ButtonLabel.text=NewString;

What can be the issue?


回答1:


I have filed a bug report on this bug to Apple. After few weeks they replied and requested to check the issue with the updated IOS. It worked better and accepted longer texts. Later they fully solved the problem.



来源:https://stackoverflow.com/questions/23973340/sklabelnode-creates-black-line-and-not-showing-text-on-iphone4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!