autorotate

android maps auto-rotate

瘦欲@ 提交于 2019-11-27 09:41:43
问题 If you open the Google maps app, there is a button on the top right of the screen that you can press to center the map on your current location. The button's icon then changes. If you press the same button again, the map auto-rotates based on your compass heading. In other words, the map becomes egocentric (as opposed to allocentric AKA north always up). Google recently launched maps API V2 for Android and I certainly like it more than the old one. By default, android maps V2 will include the

disable autorotate on a single UIViewController in iOS6

不羁的心 提交于 2019-11-27 07:28:02
I have a project using UINavigationController and segues working properly good, all of them rotate correctly, the thing is... I just want to disable autorotation on a specific UIViewController . I tried this: - (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { return NO; } // New Autorotation support for iOS 6. - (BOOL)shouldAutorotate NS_AVAILABLE_IOS(6_0){ return NO; } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } but it's not working, my UIViewController keeps rotating automatically, any help will be

Rotation behaving differently on iOS6

雨燕双飞 提交于 2019-11-27 04:16:31
I did an App which is tab-based. Nothing needs to be on landscape mode but a couple of views. It worked OK on iOS5 and I was pretty happy with the result. However with iOS6 and without messing with anything, it now rotates all the views and the consequences are not nice. Because its a tab-based app, the couple of view I need in landscape are modalViews. That way I didn't mess with the tabbar and I had only to chose portrait in the "Supported Orientations" setting on build options and set: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return

Disable autorotate on a single subview in iOS8

蹲街弑〆低调 提交于 2019-11-27 03:32:31
问题 I'm writing a drawing app and I don't want the drawing view to rotate. At the same time, I want other controls to rotate nicely depending on the orientation of the device. In iOS 7 I've solved this via: - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { float rotation; if (toInterfaceOrientation==UIInterfaceOrientationPortrait) { rotation = 0; } else if (toInterfaceOrientation=

Mobile site - force landscape only / no auto-rotate

北城余情 提交于 2019-11-26 20:21:45
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! Use media queries to test the orientation, in the portrait stylesheet hide everything and show a message that the app only works on landscape mode. <link rel="stylesheet" type="text/css" href="css/style_l.css" media="screen and (orientation: landscape

How to make app fully working correctly for autorotation in iOS 6?

匆匆过客 提交于 2019-11-26 15:14:49
In iOS6, shouldAutorotateToInterfaceOrientation is deprecated. I tried to use supportedInterfaceOrientations and shouldAutorotate to make app working correctly for autorotation but failed. this ViewController I don’t want to rotate, but it doesn't work. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } -(BOOL)shouldAutorotate { return NO; } -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } Any ideas? Thanks for any help in advance! Figured it

disable autorotate on a single UIViewController in iOS6

折月煮酒 提交于 2019-11-26 13:17:55
问题 I have a project using UINavigationController and segues working properly good, all of them rotate correctly, the thing is... I just want to disable autorotation on a specific UIViewController . I tried this: - (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { return NO; } // New Autorotation support for iOS 6. - (BOOL)shouldAutorotate NS_AVAILABLE_IOS(6_0){ return NO; } - (NSUInteger)supportedInterfaceOrientations { return

How do I programmatically set device orientation in iOS 7?

故事扮演 提交于 2019-11-26 11:10:58
I am working on an iPad app, using AutoLayout, where if the user enables a certain mode ("heads-up" mode), I want to support only portrait (or portrait upside down) orientation, and furthermore, if the device is in landscape, I'd like to automatically switch to portrait mode. In the top view controller, I have the following: - (NSUInteger) supportedInterfaceOrientations { if (self.modeHeadsUp) { return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown; } else { return UIInterfaceOrientationMaskAll; } } - (BOOL) shouldAutorotate { return TRUE; } Based on answers

Rotation behaving differently on iOS6

给你一囗甜甜゛ 提交于 2019-11-26 11:07:25
问题 I did an App which is tab-based. Nothing needs to be on landscape mode but a couple of views. It worked OK on iOS5 and I was pretty happy with the result. However with iOS6 and without messing with anything, it now rotates all the views and the consequences are not nice. Because its a tab-based app, the couple of view I need in landscape are modalViews. That way I didn\'t mess with the tabbar and I had only to chose portrait in the \"Supported Orientations\" setting on build options and set:

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

∥☆過路亽.° 提交于 2019-11-26 09:50:55
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 view controllers to return YES for the allowable orientations. Everything worked as described above,