最近、iPhone4をiOS6にアップグレードしました。そうすると、モーダルダイアログを表示するときに、作業中のアプリの1つが期待どおりに動作しなくなっていることに気付きました。
UIModalTransitionStyleFlipHorizontalを使用しています。
問題は、アニメーション中に、ビューの中間のペイント状態としてしか説明できないものが表示されることです。ビューが部分的にペイントされているのが一時的に表示され、最後にビュー全体が描画されます。私はiOS6の前にこれを経験したことがありません。
フローは次のとおりです。
ViewControllerは、モーダルダイアログをユーザーに提示するときが来たと判断します。
self.newController = [[NewViewController alloc] initWithNibName:@"PaginatedView" bundle:[NSBundle mainBundle]];
self.newController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:self.newController animated:YES];
NewViewControllerは、ページのビューを初期化します。
(NewViewController:initWithNibName:bundle:)から呼び出されます
NSUInteger pages = 2;
CGFloat cx = 0;
for (int i = 0; i < pages ; i++) {
// Load the view from nib
NSArray *nibObjects = [[NSBundle mainBundle] loadNibNamed:@"SomeView" owner:nil options:nil];
SomeView* someView = (SomeView*)[nibObjects objectAtIndex:0];
[someView initializeWithData:[_objects objectAtIndex:i]];
[someView setParentController:self];
[someView setBackButtonTarget:self withSelector:@selector(backButtonClick:)];
// Set the x origin for the view
CGRect viewRect = someView.frame;
viewRect.origin.x = ((self.scrollView.frame.size.width - viewRect.size.width) / 2) + cx;
viewRect.origin.y = ((self.scrollView.frame.size.height - viewRect.size.height) / 2);
someView.frame = viewRect;
[self.scrollView addSubview:someView];
cx += self.scrollView.frame.size.width;
}
self.pageControl.numberOfPages = pages;
[self.scrollView setContentSize:CGSizeMake(cx, [scrollView bounds].size.height)];
オブジェクトSomeViewは、ユーザーにテーブルを表示するビューです。アニメーションの再生中、テーブルとそのヘッダーが空になっているのが一瞬表示され、最後にコンテンツが入ります。
modalTransitionStyleを他のスタイルに切り替えると問題は解決しますが、UIModalTransitionStyleFlipHorizontalを使用したいと思います。
何が起こっているのか、どうすれば修正できるのかについてのアイデアはありますか?
また、私はiOS6を実行しているiPhone4Sでこれを試しました。問題ありません...iOS6がiPhone4のエクスペリエンスをひどくしたようです...