autorotate
UIActionSheet centralisation on rotation
UIActionSheet is a UIView subclass, so you can set the frame of it if you want. I just tested it and setting the frame has the desired effect.
How to rotate sub-views around their own centres?
I really like this question. I also find the rotation animation jarring for some interfaces. Here’s how I would implement what you have pictured. A simple @interface will be just fine. Note: I am using ARC. #import <UIKit/UIKit.h> @interface ControllerWithRotatingButtons : UIViewController @property (strong, nonatomic) IBOutlet UIButton *buttonA; @property (strong, nonatomic) IBOutlet UIButton *buttonB; @property … Read more
Infinitely rotate rectangle in XAML
Something like this <Rectangle x:Name=”rect1″ RenderTransformOrigin=”0.5, 0.5″> <Rectangle.RenderTransform> <!– giving the transform a name tells the framework not to freeze it –> <RotateTransform x:Name=”noFreeze” /> </Rectangle.RenderTransform> <Rectangle.Triggers> <EventTrigger RoutedEvent=”Loaded”> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetProperty=”(Rectangle.RenderTransform).(RotateTransform.Angle)” To=”-360″ Duration=”0:0:1″ RepeatBehavior=”Forever” /> </Storyboard> </BeginStoryboard> </EventTrigger> </Rectangle.Triggers> </Rectangle> Of course you can remove Loaded trigger and run this storyboard whenever you … Read more
How do I programmatically set device orientation in iOS 7?
For iOS 7 & 8: Objective-C: NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft]; [[UIDevice currentDevice] setValue:value forKey:@”orientation”]; Swift 3+: let value = UIInterfaceOrientation.landscapeLeft.rawValue UIDevice.current.setValue(value, forKey: “orientation”) I call it in – viewDidAppear:.
iOS 6: How do I restrict some views to portrait and allow others to rotate?
I had the same problem and found a solution that works for me. To make it work, it is not sufficient to implement – (NSUInteger)supportedInterfaceOrientations in your UINavigationController. You also need to implement this method in your controller #3, which is the first one to be portrait-only after popping controller #4. So, I have the … Read more
How to force view controller orientation in iOS 8?
For iOS 7 – 10: Objective-C: [[UIDevice currentDevice] setValue:@(UIInterfaceOrientationLandscapeLeft) forKey:@”orientation”]; [UINavigationController attemptRotationToDeviceOrientation]; Swift 3: let value = UIInterfaceOrientation.landscapeLeft.rawValue UIDevice.current.setValue(value, forKey: “orientation”) UINavigationController.attemptRotationToDeviceOrientation() Just call it in – viewDidAppear: of the presented view controller.