項(xiàng)目中需要實(shí)現(xiàn)單個(gè)界面的橫屏,通過(guò)tranform來(lái)旋轉(zhuǎn)屏幕的時(shí)候,需要同時(shí)旋轉(zhuǎn)一下?tīng)顟B(tài)欄。但是直接設(shè)置setStatusBarOrientation這個(gè)是無(wú)效的。
- 必須保證- (BOOL)shouldAutorotate返回的是NO。
- 同時(shí),如果是NavgationController的話,需要設(shè)置NavgationController的shouldAutorotate,否則也是無(wú)效的
- (BOOL)shouldAutorotate {
return [[self.viewControllers lastObject] shouldAutorotate];
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}
簡(jiǎn)單記錄一下問(wèn)題。具體可以參考http://blog.csdn.net/ginhoor/article/details/20454229