autorotate

Prevent AlertView from auto rotating

喜欢而已 提交于 2019-12-01 21:44:44
The launch page of my app is set to portrait only with this little bit of code: - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait ; } When the app launches a UIAlertView appears for username and password entry. The method to display it is called from viewWillAppear . This worked fine for iOS6 but since iOS7 , if I switch the device to landscape, the main view remains in portrait but the the alert view and keyboard rotate to landscape. A further bizarre quirk is that when I switch back to portrait, only the keyboard switches back (in truncated form),

Stop a modal UIViewController from rotating

自作多情 提交于 2019-12-01 09:21:35
The modal UIViewController 's parent auto-rotates, but when the modal VC is up I only want it to appear in portrait and not be rotatable. I have tried simply returning NO from shouldAutorotate ... in the modal VC, but no joy. Supporting iOS 5+. Any help greatly appreciated. Basically, if you presenting Modal Controller on Any Container Controllers (i.e. UINavigationController) it have autorotation method return YES by default. So you have to make subclass for your UINavigation Controller and Deprecate Autorotation there. For iOS 5 use method: - (BOOL)shouldAutorotateToInterfaceOrientation:

How to use the autorotate plugin in ImageResizer

↘锁芯ラ 提交于 2019-12-01 05:50:49
How do I use the AutoRotate plugin in a c# console application? I thought I'd be able to do something like settings.AutoRotate = true; like I can change the fit mode to use the seam carving plugin. I've tried settings.Add("autorotate","true") to the keycollection, as well as other keynames AutoRotate and autoRotate . I'm using it in a simple method. new AutoRotate().Install(ImageResizer.Configuration.Config.Current); ... protected static Image ResizeImage(Image image, double scaleFactor) { var settings = new ResizeSettings { Scale = ScaleMode.Both, Width = (int)Math.Floor(Image.Width *

Stop a modal UIViewController from rotating

假如想象 提交于 2019-12-01 05:12:07
问题 The modal UIViewController 's parent auto-rotates, but when the modal VC is up I only want it to appear in portrait and not be rotatable. I have tried simply returning NO from shouldAutorotate ... in the modal VC, but no joy. Supporting iOS 5+. Any help greatly appreciated. 回答1: Basically, if you presenting Modal Controller on Any Container Controllers (i.e. UINavigationController) it have autorotation method return YES by default. So you have to make subclass for your UINavigation Controller

How to use the autorotate plugin in ImageResizer

霸气de小男生 提交于 2019-12-01 03:09:51
问题 How do I use the AutoRotate plugin in a c# console application? I thought I'd be able to do something like settings.AutoRotate = true; like I can change the fit mode to use the seam carving plugin. I've tried settings.Add("autorotate","true") to the keycollection, as well as other keynames AutoRotate and autoRotate . I'm using it in a simple method. new AutoRotate().Install(ImageResizer.Configuration.Config.Current); ... protected static Image ResizeImage(Image image, double scaleFactor) {

iOS 6.0 restrict auto rotation within a navigation controller?

不想你离开。 提交于 2019-12-01 00:27:25
What else should I do? -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) toInterfaceOrientation { return (toInterfaceOrientation == UIInterfaceOrientationPortrait); } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } -(BOOL)shouldAutoRotate { return NO; } My viewController still rotates. It is embedded in a navigation stack. If I subclass UINavigationController, and implement the same portrait-only templates there, and I embed my viewController in that tweaked navigationController, than it works, but I have no intention to rewrite

Only having one view autorotate in xcode?

六月ゝ 毕业季﹏ 提交于 2019-11-30 17:29:40
问题 Ok so I currently have 3 views and I need only one of them to autorotate to any orientation while the rest stay in portrait. Right now my set up is a splashviewcontroller fades into view A, and inside view A is a button to switch to view B. All I want is for view B to be able to rotate to any orientation. When I return YES for shouldautorotatetointerfaceorientation in the splashviewcontroller, every view rotates because this is the parent view. When I return portrait only in the splashview,

“viewWillTransitionToSize:” not called in iOS 9 when the view controller is presented modally

删除回忆录丶 提交于 2019-11-30 17:12:12
I present a view controller from another one: - (void)showModalView { UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; MySecViewController *mySecViewController = [storyboard instantiateViewControllerWithIdentifier:@"secController"]; mySecViewController.delegate = self; [self presentViewController:mySecViewController animated:YES completion:nil]; } Then in the presented UIViewController , the method viewWillTransitionToSize:withTransitionCoordinator: is called in iOS 8 but not in iOS 9 ... Thanks In your current view controller, if you override

Autorotating video played from HTML5 <video> in UIWebView

喜欢而已 提交于 2019-11-30 14:51:48
My app, for some reasons, only supports portrait orientation. However, in some cases I need to display videos from a UIWebView (with video tag) and it would be nice if the user can view it either in portrait or landscape. The controller is configured like this: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { return UIInterfaceOrientationIsPortrait(toInterfaceOrientation); } Result : the video is played only in portrait mode (ok, quite expected). I tried: - setting this to support all orientations when the user starts a video - when the video

How to handle autorotation in AVCaptureVideoPreviewLayer?

牧云@^-^@ 提交于 2019-11-30 04:01:13
My application supports all orientations except PortraitUpsideDown. In my view hierarchy I have an AVCaptureVideoPreviewLayer as a sublayer in the top view which is UIImageView. Then below it in view hierarchy are several overlay views showing controls. Overlay views are working properly with orientation changes, but I don't how to be with this AVCaptureVideoPreviewLayer. I want it to behave like in Camera app, so that previewLayer stays still and controls are smoothly reorganized. Right now since the main view is rotated on orientation change, my preview layer is also rotated, which means