是否可以关闭自动旋转动画?我希望它旋转,但我只是不希望发生动画(就像即时切换一样)。
如果你确实需要,只需使用setAnimationsEnabled
of UIView
:
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
[UIView setAnimationsEnabled:NO]; // disable animations temporarily
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
[UIView setAnimationsEnabled:YES]; // rotation finished, re-enable them
}
它对我有用。当然,除非您有充分的理由,否则不建议这样做。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)