iPhone等のデバイスを回転した時、拡張キーボードを縦横で変更するようにしていたりすると、アニメーションがガチャガチャして格好が悪くなります。そのような場合にアニメーションをさせないようにして誤魔化す方法です。副作用として動作がキビキビになります:-)
ObjectiveC
@interface ViewController : UIViewController
@end
@implementation ViewController
static BOOL needRevert;
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
needRevert = [UIView areAnimationsEnabled];
[UIView setAnimationsEnabled:NO];
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
if (needRevert) [UIView setAnimationsEnabled:YES];
}
@end