iphone autorotation动画

iphone autorotation动画,第1张

概述是否可以关闭自动旋转的动画?我想让它旋转,但我只是不想要动画发生(就像一个即时开关). 只需添加以下代码即可覆盖标准旋转动画: - (void)viewDidLoad{ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotate:) name:UIDeviceOrientati 是否可以关闭自动旋转的动画?我想让它旋转,但我只是不想要动画发生(就像一个即时开关).解决方法 只需添加以下代码即可覆盖标准旋转动画:

- (voID)vIEwDIDLoad{    [[NSNotificationCenter defaultCenter] addobserver:self selector:@selector(dIDRotate:)   name:UIDeviceOrIEntationDIDChangeNotification object:nil];}- (voID)dIDRotate:(NSNotification *)notification {    orIEntation = [[UIDevice currentDevice] orIEntation];    if(orIEntation == UIDeviceOrIEntationUnkNown || orIEntation == UIDeviceOrIEntationFaceDown || orIEntation == UIDeviceOrIEntationFaceUp){        orIEntation = UIDeviceOrIEntationPortrait;    }    [[UIApplication sharedApplication] setStatusbarOrIEntation:orIEntation animated:NO];    [self positionScreenElements];}
总结

以上是内存溢出为你收集整理的iphone autorotation动画全部内容,希望文章能够帮你解决iphone autorotation动画所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1081291.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-27
下一篇2022-05-27

发表评论

登录后才能评论

评论列表(0条)

    保存