次のビュー階層があります
- UIScrollView (水平スクロール)
- UIScrollView (縦スクロール)
- UIViewController
- UIScrollView (縦スクロール)
実際、複数の Sub ScrollView を持つ Root ScrollView Controller があります。(ルート ScrollViewController は水平方向にのみスクロールし、サブは垂直方向にのみスクロールします)。各 Sub ScrollView には UIViewController があります。
私のルート ScrollView コントローラーは期待どおりに動作し、次のような回転メソッドを呼び出します。
- (BOOL)shouldAutorotateToInterfaceOrientation (UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
- (void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
[self rotateScrollViewToInterfaceOrientation:toInterfaceOrientation];
}
- (void) rotateScrollViewToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if (UIInterfaceOrientationIsLandscape(interfaceOrientation))
{
// do some rotation logic
}
}
Sub ScrollViews と UIViewControllers で同じメソッドを使用しましたが、回転時に呼び出されません。
誰にも理由がありますか?