uiinterfaceorientation

Forced orientation change does not work sometimes

家住魔仙堡 提交于 2019-12-04 05:17:01
When a certain button is pressed in my app, the view should change orientation from portrait to landscape. When the user comes back, the view controller should change back to portrait. But sometimes the orientation doesn't change or the wrong view frame is used. Here is my code -(void)btnSignClicked:(CustomSignButton *)btn { isSignButtonClicked = true; if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_0) { NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight]; [[UIDevice currentDevice] setValue:value forKey:@"orientation"]; } else { [[UIApplication

UIScrollview content size when orientation changes

流过昼夜 提交于 2019-12-04 03:37:56
问题 I have a scrollview with pagination. In viewDidLoad i check if the current orientation is landscape then i set its contentsize's height 440 if (UIDeviceOrientationIsPortrait([[UIDevice currentDevice] orientation])) { [scroll setContentSize:CGSizeMake(self.scroll.frame.size.width*numberOfPages,340)]; } else if (UIDeviceOrientationIsLandscape([[UIDevice currentDevice] orientation])) { [scroll setFrame:CGRectMake(0,0,480,480)]; [scroll setContentSize:CGSizeMake(self.scroll.frame.size.width

iOS 7. Change page orientation only for one view controller

落爺英雄遲暮 提交于 2019-12-04 03:29:50
问题 I have iPhone application that supports only Portrait orientation. I want to add to my project view controller that will support only Landscape orientation? Is it possible? If yes how could I achieve that? I have tried to crate category file like this: @implementation UINavigationController (Rotation_IOS7) -(BOOL)shouldAutorotate { return YES; } -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } If I do this I get this error: Terminating app due to

UISplitViewController and orientation - iOS < 5.0

a 夏天 提交于 2019-12-04 03:18:05
问题 I am using a splitviewcontroller as the rootview of my application. I need to show the login and registration views as a modal view on top of the splitviewcontroller. When i try presenting login/reg view from the viewdidAppear method of splitViewController's rootview, it is not showing up. I tried presenting the login/reg view from the Appdelegate's didFinishLaunching method using the following code [self.window.rootViewController presentModalViewController:self.navController animated:NO];

Upside down orientation not working in iOS6 for UINavigation view and UITabbar view?

冷暖自知 提交于 2019-12-04 00:49:49
I created an app in ios 6 with navigation view.Also I have set all orientation options in the application summary and even used the -(BOOL) shouldAutoRotate and -(NSUInteger) supportedInterfaceOrientaion methods in my view controller.when I run my app orientation works fine except upside-down.What should I do to also support upside-down. I also facing the same problem when I add UITabBar controller. Please share your ideas. Thank you Hai I have found solution for my problem Solution: For the app which consist UINavigation controller, just I created a category for UINavigation Controller class

How to rotate a view in controller that is not allowed to rotate its interface?

筅森魡賤 提交于 2019-12-03 16:57:32
Help me to solve the task - I have a viewController that is not allowed to rotate its interface: - (BOOL)shouldAutorotate { return NO; } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } But I need to rotate alertView which appears in this controller! So if user rotates the device the alertView should follow the rotation and the main interface stands still. I've tried to subscribe to notification: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceRotated:) name:UIDeviceOrientationDidChangeNotification object:nil]; But in

iOS 6 UIInterfacePortrait ONLY viewcontroller being presented & stuck in landscape… when coming back from a landscape viewcontroller in nav stack

和自甴很熟 提交于 2019-12-03 14:52:54
问题 So like many others, I ran into the problem of only having one or two viewcontrollers support both portrait and landscape interface orientations, in an otherwise portrait only app. Everything worked fine prior to iOS 6, but suddenly autorotating stopped working. Thanks to some great questions here, I was able to resolve that issue by having the initial navController return the individual topViewController's preference for shouldAutorotate via: - (BOOL)shouldAutorotate { return self

willRotateToInterfaceOrientation not called on iOS8

别说谁变了你拦得住时间么 提交于 2019-12-03 13:15:19
I'm using the VFR PDF viewer library in my app, where I present it thus: ReaderDocument *document = [ReaderDocument withDocumentFilePath:pdfFile password:nil]; ReaderViewController *vc = [[ReaderViewController alloc] initWithReaderDocument:document]; [self.navigationController pushViewController:vc animated:YES]; If I run on iOS7, everything works fine. If I run my app on iOS8, the willRotateToInterfaceOrientation method in ReaderViewController never gets called, so when the device is rotated the document doesn't get reformatted correctly. However, if I run the demo app that comes with the

Modal View Controller force Landscape orientation in iOS 6

断了今生、忘了曾经 提交于 2019-12-03 12:48:00
I have a UITabBarController presented in Portrait mode. On one of the tabs I have a button that shows a UIViewController modally (A simple storyboard segue performs the action). I want this modal view to be shown in Landscape mode, but I can't get it to turn automatically. I have this in the modal views controller - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft); } I've added landscapeLeft to the .plist supported orientations (although this also allows the TabBar to be rotated

iOS 8 GM does not update constraints on collection views

时光总嘲笑我的痴心妄想 提交于 2019-12-03 11:52:06
In Xcode 6 Beta 7 and all versions before it, I had a collection view that would update its constraints on its cells when an iPad would rotate between landscape and portrait. Now, it doesn't update at all, and in fact it looks exactly like how I leave it in the XIB, which implies to me that it's not updating at all. It appears that the reusable views I'm using are updating correctly, but the cells certainly are not. Has anyone else run into this issue yet? Anyone have any ideas for how to get past it? I'm using the iOS 7.1 simulator. Sean Freitag You need to make a subclass of