在 Xcode 6 Beta 4 中,使用 SKShapeNode 抚摸不再起作用
在 Xcode 6 beta 2 中它运行良好,但在 beta 4 中它不再起作用.有谁知道这个谜团的背后是什么?
In Xcode 6 beta 2 it worked fine, but in beta 4 it doesn't work anymore. Does anyone know what's behind this mystery?
let circle = SKShapeNode(circleOfRadius: 125);
circle.strokeColor = UIColor(red: 255, green: 255, blue: 255, alpha: 1.0);
circle.lineWidth = 4
self.addChild(circle);
在 beta 4 中什么都看不到.
In beta 4 nothing can be seen.
提前感谢您的帮助.
这是使用模拟器时 Xcode 6 Beta 4 的常见问题.使用实际设备时效果很好.查看此开发者论坛主题.值得注意的是,该问题仅限于在该设置中抚摸 circle.fillColor
仍然正确填充圆圈(或您的 SKShapeNode
正在绘制的任何内容).
This is a common issue with Xcode 6 Beta 4 when using the simulator. It renders fine when using an actual device. See this developer forums thread. It is worth noting that the issue is exclusive to stroking in that setting circle.fillColor
still fills the circle (or whatever your SKShapeNode
is drawing) correctly.
还要记住,当初始化UIColor
带有 RGB 值 RGB 值必须介于(包括)0.0 和 1.0 之间.
Also keep in mind that when initializing a UIColor
with RGB values the RGB values must be between (inclusive) 0.0 and 1.0.
circle.strokeColor = UIColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0);
或者使用预设:
circle.strokeColor = UIColor.whiteColor()