I had a problem with the rotation of the device. With the exception of ONE view, where I show the company screensaver, I want to block all other types of applications on the portrait display. In the project settings, the supported orientations are Portrait and LandscapeLeft. At Splash Company, it works great, and the rotation of my vision is blocked in LandscapeLeft no matter how I rotate the device. In all other views, when I turn the device to the left, the view changes instead of remaining on the portrait display. Do the methods not even shoot? If I delete an album remaining from the supported Orientations in the project, it overshadows the look of the "Splash" company. I tried changing shouldAutorotate to NO , but that didn't help. I tried to make my way through the proposed proposals here , but it did not help. If I add the following code to my AppDelegate.m, everything will be blocked in portrait mode, and upon access, the "Company Splash" crashes.
-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown; }
How to block viewing in portrait mode no matter how the device is turned, except for one screen?
** from the presentation "Company Splash". Again, it works as intended.
-(NSInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscapeLeft; }
** from all other species that rotate from a portrait when I do not want them
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // IOS5 Only returning that it should rotate to potrait return (interfaceOrientation == UIDeviceOrientationPortrait); } -(BOOL)shouldAutorotate { // forcing the rotate IOS6 Only return YES; } -(NSInteger)supportedInterfaceOrientations { // return number or enum IOS6 Only return UIInterfaceOrientationMaskPortrait; }
I thought maybe this could be because the UITabBarController is the root controller and am I in the ViewController? Do the methods not even shoot?
source share