开发者

StatusBarOrientation animation problem on iPad

开发者 https://www.devze.com 2023-02-17 03:30 出处:网络
I\'m developing app for iPhone that is show other view each orientation(Portrate and Landscape). and I programed no statusBar animation like this.

I'm developing app for iPhone that is show other view each orientation(Portrate and Landscape).

and I programed no statusBar animation like this.

[application setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];

But when I launch app on iPad and rotate it,

statusBar Animation occered!

Wh开发者_运维百科y statusBar Animation setting is ignored?


It is possible to disable the animation, without breaking everything apart.

The following codes will disable the "black box" rotation animation, without messing with other animations or orientation code:

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
    [UIView setAnimationsEnabled:YES];
}


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    [UIView setAnimationsEnabled:NO];
  /* Your original orientation booleans*/
}

Place it in your UIViewController and all should be well. Same method can be applied to any undesired animation in iOS.

Best of luck with your project.


Have you added the orientation setting to your info.plist file?

<key>UIInterfaceOrientation~ipad</key>
<string>UIInterfaceOrientationLandscapeLeft</string>
0

精彩评论

暂无评论...
验证码 换一张
取 消