iOS 8 - App not rotating appropriately

前端 未结 3 1883
梦谈多话
梦谈多话 2021-01-02 05:06

I have an app originally developed for iOS 7.1 that I am now testing on an iPad through Xcode 6.1. When running on an iPad running 7.1 or in the 7.1 simulator the app funct

相关标签:
3条回答
  • 2021-01-02 05:38

    I had a similar problem and I fixed it by removing the UIMainStoryboardFile and UIMainStoryboardFile~ipad keys from app's information property list

    Give a look to this discussion https://devforums.apple.com/message/1064397#1064397

    0 讨论(0)
  • 2021-01-02 05:51

    Use viewWillTransitionToSize:withTransitionCoordinator: like so:

    - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
    {
        [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
    
        // Will rotate
    
        [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
            // Will animate rotation
        } completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
            // Did rotate
        }];
    }
    

    You should take a look at the WWDC 2014 video "View Controller Advancements in iOS 8" where this is discussed.

    0 讨论(0)
  • 2021-01-02 05:56

    Are you using storyboards? If so, you may have old code in your application didFinishLaunchingWithOptions method.

    Try removing the following line of code and any others to do with UIWindow:

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    

    Others have said to remove lines from your plist file but that shouldn't be necessary.

    0 讨论(0)
提交回复
热议问题