Questions tagged [autorotate]
527 questions
155
votes
25 answers
How to force view controller orientation in iOS 8?
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…

Rashmi Ranjan mallick
- 6,390
- 8
- 42
- 59
100
votes
15 answers
iOS 6: How do I restrict some views to portrait and allow others to rotate?
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…

Harald Bögeholz
- 1,163
- 2
- 8
- 8
76
votes
18 answers
How do I programmatically set device orientation in iOS 7?
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…

John Stewart
- 1,176
- 1
- 10
- 22
36
votes
2 answers
How to rotate sub-views around their own centres?
Is it possible to rotate a view around its own centre?
In my present implementation the sub-views (buttons, etc) seem to move along a funny path before they end up in the desired positions (since the super view's coordinate system is rotated). I…

ragnarius
- 5,642
- 10
- 47
- 68
36
votes
1 answer
Infinitely rotate rectangle in XAML
How to define XAML to rotate a rectangle infinitely?
So far I found a solution with code but no xaml:
http://www.codeproject.com/Articles/23257/Beginner-s-WPF-Animation-Tutorial
which I use like this:
private void Window_Loaded_1(object sender,…

Bruno Bieri
- 9,724
- 11
- 63
- 92
34
votes
1 answer
UIActionSheet centralisation on rotation
A number of others have asked this question, but it's never been answered. The problem seems trivial and yet it hasn't been addressed in Apple's documentation or elsewhere.
I'm presenting my UIActionSheet instance using the showInView method:
…

Vinod Vishwanath
- 5,821
- 2
- 26
- 40
31
votes
6 answers
overriding shouldAutorotate not working in Swift 3
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:…

pableiros
- 14,932
- 12
- 99
- 105
24
votes
6 answers
Mobile site - force landscape only / no auto-rotate
I have a site that has a mobile stylesheet:
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…

Joey
- 10,504
- 16
- 39
- 54
23
votes
7 answers
Keyboard "WillShow" and "WillHide" vs. Rotation
I've got a view controller listening for both UIKeyboardWillShowNotification and UIKeyboardWillHideNotification. The handlers for these notifications adjust various parts of the view, which is standard procedure.
The following code is used to…

Voobr
- 243
- 1
- 2
- 5
22
votes
4 answers
"viewWillTransitionToSize:" not called in iOS 9 when the view controller is presented modally
I present a view controller from another one:
- (void)showModalView
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
MySecViewController *mySecViewController = [storyboard…

AppsDev
- 12,319
- 23
- 93
- 186
22
votes
5 answers
android maps auto-rotate
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…

aleph_null
- 5,766
- 2
- 24
- 39
21
votes
13 answers
How to make UIPopoverController keep same position after rotating?
I can't keep popover the same position on the screen after rotation. Is there any good way to do that, because just setting some frame to popover works terrible after rotating.popover.frame = CGRectMake(someFrame); After rotation popover looks fine…

B.S.
- 21,660
- 14
- 87
- 109
19
votes
5 answers
disable autorotate on a single UIViewController in iOS6
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:
-…

Jesús Ayala
- 2,743
- 3
- 32
- 48
19
votes
4 answers
Detect rotation changes in iOS
I am making an iOS app that needs to do a little interface rearrangement upon rotation. I am trying to detect this by implementing - (void)orientationChanged:(NSNotification *)note, but this gives me notifications for when the device is face up or…

Undo
- 25,519
- 37
- 106
- 129
18
votes
1 answer
How to use Tor combine with Java
Updated my question
I'm building a crawler system by Java to compare price online. However, I worry about my IP address can be banned. So I intend to use proxy to change IP dynamic or use some tools to rotate IP automatically.
Many people said that…

Leo Le
- 815
- 3
- 13
- 33