问题
I'm trying to build a scrolling table of game center scores in an SKScene. Is there a way to use sprite kit and storyboards/xibs? [self addChild:customTable]
on an SKScene doesn't seem to work.
回答1:
UIKit elements like UITableView
, UIView
, etc cannot be used as children of SpriteKit nodes. You can place a UITableView
on top of a SKView
/UIView
but that comes out as crude. I would suggest you use a normal UIViewController
to display your Game Center scores.
However, if you still need to display the scores using SpriteKit, there is a component called ScrollNode which might do the trick. You can find it here.
来源:https://stackoverflow.com/questions/22339818/sprite-kit-table-view