- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration

 

1. shouldAutorotateToInterfaceOrientation的调用

    a. 子viewcontroller中的shouldAutorotateToInterfaceOrientation只在初始化时调用一次,并且感觉没什么用。

        假设 root viewcontrollershouldAutorotateToInterfaceOrientation支持为all

                子viewcontroller的shouldAutorotateToInterfaceOrientation支持为UIInterfaceOrientationIsPortrait

        结果 viewcontroller 将在 4个方向上旋转

    b. root viewcontroller中的shouldAutorotateToInterfaceOrientation,在屏幕旋转时总会调用。

 

2. willRotateToInterfaceOrientation

   只会在root shouldAutorotateToInterfaceOrientation支持的方向上调用,willRotateToInterfaceOrientation;

相关文章:

  • 2022-01-13
  • 2022-01-12
  • 2021-06-25
  • 2022-02-26
  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
  • 2021-08-05
  • 2021-07-03
  • 2021-11-03
相关资源
相似解决方案