Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS:WillAnimateRotationInterfaceOrientation即使使用shouldAutorotateToInterfaceOrientation也不会被调用_Ios_Uiwebview_Uitabbarcontroller_Orientation_Screen Orientation - Fatal编程技术网

iOS:WillAnimateRotationInterfaceOrientation即使使用shouldAutorotateToInterfaceOrientation也不会被调用

iOS:WillAnimateRotationInterfaceOrientation即使使用shouldAutorotateToInterfaceOrientation也不会被调用,ios,uiwebview,uitabbarcontroller,orientation,screen-orientation,Ios,Uiwebview,Uitabbarcontroller,Orientation,Screen Orientation,我有 及 但在我的日志中,“hello there”从未出现过,即使“shouldRotate”出现过 我的设置是这样的,我有一个TabBarController,里面有4个常规视图控制器。特别是这个选项卡里面有一个WebView。当我改变方向时,什么也没发生 我应该在AppDelegate级别做些什么吗 有人能帮我理解发生了什么吗?如果要使用TabBarController设置旋转动画,所有选项卡栏上的ViewController都应该为支持的方向返回YES shouldAutorotateT

我有

但在我的日志中,“hello there”从未出现过,即使“shouldRotate”出现过

我的设置是这样的,我有一个TabBarController,里面有4个常规视图控制器。特别是这个选项卡里面有一个WebView。当我改变方向时,什么也没发生

我应该在AppDelegate级别做些什么吗


有人能帮我理解发生了什么吗?

如果要使用TabBarController设置旋转动画,所有选项卡栏上的ViewController都应该为支持的方向返回YES


shouldAutorotateToInterfaceOrientation正是您可以配置此设置的位置。

在其他3个视图控制器的
shouldAutorotateToInterfaceOrientation:
中,您会返回什么
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

    NSLog(@"shouldRotate");
    return YES;
}
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration {
    NSLog(@"Hello there");

    [self.webpage setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];

}