Thorsten
Thorsten

Reputation: 103

Mobile Safari / iPhone - Orientation of 180° not recognized

Mobile Safari doesn't seem to recognize an orientation of 180° on the iPhone.

If I change the orientation from 0° to 90° to 180° the view remains in landscape mode. Also no orientation change event is fired on an orientation value of 180.

Is this a known bug? If so, is there a workaround?

Please be aware that I'm using the iOS Simulator. An iPhone is not at my disposal.

Upvotes: 0

Views: 204

Answers (2)

Michael Dimitras
Michael Dimitras

Reputation: 21

Apple's Human Interface Guidelines imply that is is possible, just not on certain devices.

https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/adaptivity-and-layout/

An app that runs only in portrait mode should rotate its content 180 degrees when the device rotates 180 degrees — except on iPhone X, which doesn’t support upside-down portrait mode.

Their documentation on supportedInterfaceOrientations tells a similar story.

https://developer.apple.com/documentation/uikit/uiviewcontroller/1621435-supportedinterfaceorientations

For example, the UIInterfaceOrientation.portraitUpsideDown orientation is not supported on iPhone X.

Also see:

App rotates to landscape and portrait, but won't rotate upside down

Cannot rotate interface orientation to portrait upside down on iPhone X

Upvotes: 1

Thorsten
Thorsten

Reputation: 103

It's not a bug, it's a feature! :)

Looks like Mobile Safari on iPhone doesn't support an upside-down portrait view. I say "looks like", because I didn't find any official statement regarding the supported orientations, but several inofficial ones, e.g. in Nicholas C. Zakas' book Professional JavaScript for Web Developers (Page 418, Paragraph 1).

Upvotes: 1

Related Questions