每次我在我的模拟器中运行我的应用程序时,视图比例总是出现在768,1024之间,您如何将其更改为1024,768。这里是默认大小码 类GameViewController:UIViewController的{如何更改SKscene大小
override func viewDidLoad() {
super.viewDidLoad()
if let scene = GameScene(fileNamed:"GameScene") {
// Configure the view.
let skView = self.view as! SKView
skView.showsFPS = true
skView.showsNodeCount = true
/* Sprite Kit applies additional optimizations to improve
rendering performance */
skView.ignoresSiblingOrder = true
/* Set the scale mode to scale to fit the window */
scene.scaleMode = .AspectFill
skView.presentScene(scene)
}
}
'scene.size = ...'你可以从上面从viewDidLoad中移动你的代码viewWillLayoutSubviews或viewDidAppear ... http://stackoverflow.com/a/26266857/1702413 – TonyMkenu
ViewWillLayoutSubviews没有意义。 – crashoverride777
你只是想改变屏幕方向? – septicorn