2012-01-19 103 views

回答

0

如果不设置视图控制器作为窗口的根视图控制器,你不会得到旋转通知。您可以报名参加像这样的通知:

[[NSNotificationCenter defaultCenter] addObserver:self 
              name:UIApplicationDidChangeStatusBarOrientationNotification 
             selector:@selector(orientationDidChange:) 
              object:nil]; 

然后实现一个叫做-orientationDidChange:方法,并在该方法(以及当您添加视图到窗口直接作为)设置视图的transform属性来旋转它适当。

+0

我的主视图控制器确实收到轮播通知,而不是负责此其他视图的控制器 – jfisk