旋转问题

- (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;

posted @ 2014-05-09 18:13  激情为梦想而生  阅读(105)  评论(0编辑  收藏  举报