【问题标题】:SceneKit – NSAttributedString is not shown as SCNTextSceneKit – NSAttributedString 不显示为 SCNText
【发布时间】:2018-09-05 17:26:59
【问题描述】:

为什么这些代码行有效:

let text = NSString(string: "Test")
(node.geometry as! SCNText).string = text

但这些没有:

let text = NSAttributedString(string: "Test")
(node.geometry as! SCNText).string = text

使用属性文本时,SCNText 根本不会显示。有什么想法吗?

谢谢。

【问题讨论】:

标签: ios swift 3d scenekit nsattributedstring


【解决方案1】:

我发现了自己。问题是相对于场景尺寸的字体大小。在我的情况下,标准字体大小太小了。

解决了!

【讨论】:

    猜你喜欢
    • 2019-05-09
    • 1970-01-01
    • 1970-01-01
    • 2017-12-23
    • 2018-10-06
    • 2015-02-19
    • 2020-05-18
    • 1970-01-01
    • 2017-08-23
    相关资源
    最近更新 更多