SpriteKit:属性 用于禁用点击和触摸?
SpriteKit: property for disabling taps and touches?
userInteractionEnabled
好像只能禁用触摸?如果我们需要忽略点击和触摸怎么办?是否有类似于 userInteractionEnabled 的 属性 也会导致点击被忽略?这是 Swift.
您可以使用 UIApplication.sharedApplication
中的 beginIgnoringInteractionEvents
:
//Start ignoring
UIApplication.sharedApplication().beginIgnoringInteractionEvents()
要结束忽略,您只需使用 endIgnoringInteractionEvents
//End Ignoring
UIApplication.sharedApplication().endIgnoringInteractionEvents()
userInteractionEnabled
好像只能禁用触摸?如果我们需要忽略点击和触摸怎么办?是否有类似于 userInteractionEnabled 的 属性 也会导致点击被忽略?这是 Swift.
您可以使用 UIApplication.sharedApplication
中的 beginIgnoringInteractionEvents
:
//Start ignoring
UIApplication.sharedApplication().beginIgnoringInteractionEvents()
要结束忽略,您只需使用 endIgnoringInteractionEvents
//End Ignoring
UIApplication.sharedApplication().endIgnoringInteractionEvents()