autorotate

overriding shouldAutorotate not working in Swift 3

柔情痞子 提交于 2019-12-18 01:30:29
问题 I'm trying to prevent rotation on one UIViewController and I can't achieve that. I'm doing something like this: open override var shouldAutorotate: Bool { get { return false } } override var supportedInterfaceOrientations: UIInterfaceOrientationMask { get { return .portrait } } And the UIViewControler stills rotating. The UIViewController is inside a UINavigationController opened modally. I have looked a lot of questions from here and none answers works for me. In Swift 2 I used to override

Clean autorotation transitions in a paging UIScrollView

时间秒杀一切 提交于 2019-12-17 18:25:05
问题 I have a paging UIScrollView in which the user pages horizontally through images, like Apple's Photos.app. That works, but now I'm trying to add rotation support. I've got the view rotating OK and have managed to set the contentSize, bounds, and subviews' frames properly to adapt to the different orientations. So before and after the rotation, everything is OK. However, the transitions themselves are awkward. The first image rotates perfectly, as if the axis of rotation is in the dead center

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

岁酱吖の 提交于 2019-12-17 03:02:28
问题 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

How do I programmatically set device orientation in iOS 7?

会有一股神秘感。 提交于 2019-12-17 02:08:49
问题 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 {

iOS6.0 Pushing new viewController in portrait orientation from landscape viewController

冷暖自知 提交于 2019-12-13 04:42:22
问题 My application is navigation based and mainly runs in portrait orientation, But one view controller supports both portrait and landscape orientation. Now the problem is, When I push the new viewcontroller from landscape view controller, the new view controller is also pushed in landscape mode though i want it in portrait mode. Also when I pop view controller from landscape controller then the poped view controller is getting displayed in portrait mode. I don't know what is wrong with my code.

Autorotate is not working for google map created using google maps api

為{幸葍}努か 提交于 2019-12-13 02:55:16
问题 I have create a map now the map has to rotated in order to make it more nicer to see i tried the example from https://developers.google.com/maps/documentation/javascript/examples/aerial-rotation where i removed time interval in order to avoid auto rotation but when i integrate in the application i am getting following error ReferenceError: autoRotate is not defined <!DOCTYPE html> <html> <head lang="en"> <style> html, body, #dvMap { height: 100%; width: 100%; margin: 0px; padding: 0px } <

Set Orientation to Portrait on iPhone

爱⌒轻易说出口 提交于 2019-12-13 02:21:34
问题 I have an application that consists of a login, 3 tables, and then an image. You can rotate the image to landscape mode but what I want to be able to do is when the 'back' button is pushed and the app returns to the previous screen, I was the app to automatically rotate to give a portrait view. Is there any way of doing this? 回答1: If the previous view controller only supports portrait (see shouldAutorotateToInterfaceOrientation: ) then it should automatically rotate. If the previous view

Autorotation, UIWebView and UITabBarController

China☆狼群 提交于 2019-12-12 10:08:06
问题 I have the following View hierarchy: UITabBarController | UINavigationController | | | UIViewController (only supports Portrait rotation) | UINavigationController | | | UIViewController (only supports Portrait rotation) | UINavigationController | | | UIViewController (only supports Portrait rotation) | | | UIViewController (has UIWebView with movie in it) | UINavigationController | UIViewController (only supports Portrait rotation) The issue is now that when I display the UIWebView with the

Support rotation in only one tab on both iOS 5 and 6

放肆的年华 提交于 2019-12-12 01:02:03
问题 My app is a scorekeeper with two tabs. Tab one is where scorekeeping actually takes place, and tab two contains history of past games. Only tab one supports rotation, and when rotating it hides its navigation and tab bars (there's not enough vertical space). I do not want to support rotation at all on the history tab, because the tabbar is hidden in the counter. It is quite jarring to switch tabs and then have the tab bar disappear. There are several types of games that may be displayed in

Manual Rotation Method Breaks with Side Switch

限于喜欢 提交于 2019-12-11 18:35:56
问题 Currently I'm workign on a drawing app for the iPad. I need to reposition and rotate the toolbar in the app when it is put into a different orientation while keeping the the drawing area in the same place. I found a method here for doing this. It uses the NSNotificationCenter to monitor for rotation changes. This calls a custom didRotate: method that will rotate and reposition my toolbar based on the UIDeviceOrientation. This part works fine. However, whenever the side switch on the iPad is