Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
280 views
in Technique[技术] by (71.8m points)

ios - iOS9: Alternative to UIDevice.currentDevice().setValue(...) to force orientation

It seems to me this does not work anymore in iOS9. It was the de facto way of forcing orientation changes based my SO research. It now freezes my SpriteKit game.

Is it just me, and if not does anyone know of an alternative?

EDIT: Portrait and UpsideDown still work. It seems only Landscape modes now cause a freeze

EDIT 2: Actually I think you can go Portrait <--> UpsideDown and LandscapeLeft <--> LandscapeRight, but not in between them

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Adding to Alex's answer: My experience is that Apple only blocks the orientation change for iOS9 iPads that don't require fullscreen. So if you tell the app to require fullscreen, the rotation should work:

enter image description here

However, I have no clue whether it'll solve your SpriteKit freeze since in my experience iOS9 also introduced plenty of SpriteKit bugs.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...