autorotate

Mobile site - force landscape only / no auto-rotate

孤人 提交于 2019-11-26 07:34:12
问题 I have a site that has a mobile stylesheet: <link rel=\"stylesheet\" href=\"css/mobile.css\" media=\"handheld\"> I\'m also using jQuery to check for mobile devices and alter functionality accordingly. But I want to know if there is a way to force landscape-only orientation and disable auto-rotate? Either a CSS or a jQuery solution would be fine. Thanks! 回答1: Use media queries to test the orientation, in the portrait stylesheet hide everything and show a message that the app only works on

How to force view controller orientation in iOS 8?

与世无争的帅哥 提交于 2019-11-26 05:41:03
问题 Before iOS 8, we used below code in conjunction with supportedInterfaceOrientations and shouldAutoRotate delegate methods to force app orientation to any particular orientation. I used below code snippet to programmatically rotate the app to desired orientation. Firstly, I am changing the status bar orientation. And then just presenting and immediately dismissing a modal view rotates the view to desired orientation. [[UIApplication sharedApplication] setStatusBarOrientation

iOS 6: How do I restrict some views to portrait and allow others to rotate?

穿精又带淫゛_ 提交于 2019-11-26 03:27:27
问题 I have an iPhone app that uses a UINavigationController to present a drill-down interface: First one view, then another, up to four levels deep. I want the first three views restricted to portrait orientation and only the last view should be allowed to rotate to landscape. When returning from the fourth view to the third and the fourth view was in landscape orientation I want everything to rotate back to portrait. In iOS 5 I simply defined shouldAutorotateToInterfaceOrientation: in each of my