Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

iphone - iOS 8 upside down orientation, XCode option enabled, still doesn't work

I have a universal application being developed in iOS8 (XCode 6.1.1). It will support all the 4 orientations (left, right, portrait & upside down).

The problem is that, although in XCode the four options for supported orientations are checked, only left, right & portrait are working properly. So, is there a bug on XCode or iOS8? My info.plist shows all the supported orientations, but when I run the app on simulator or on the device it doesn't 'flip' the orientation when it's upside down. (PS: it's an singleview app, it doesn't have any navigation controller).

Thanks!

Cleverson

See Question&Answers more detail:os

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

1 Answer

0 votes
by (71.8m points)

Well, I have figured out the purpose of the the options on project configuration... Within the options you're saying "my app support these orientations" and not "my app must use these four options"... So, on iPhone you must explicity say that a particular ViewController support all orientations (the upsidedown doesn't make parte of the default orientations, for a reason that I dont know)... The code should be like this for supporting all orientations:

override func supportedInterfaceOrientations() -> Int{
    return Int(UIInterfaceOrientationMask.All.rawValue)
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...