0

在 iOS6 中,autorotate 与以前的版本不同,因为它应该与 UINavigation 一起使用。我有一个带有 UINavigation 栏的 View_A,它 pushViewController:View_B 和 View_B pushViewController:C。所以 View_A、View_B 和 View_C 都可以自动旋转。我的问题是,如果在 View_C 中我使用 addsubview 将 View_D 添加为子视图,View_D 不会自动旋转。我不知道如何在 iOS 6 中自动旋转子视图。有人和我有同样的问题吗?

4

1 回答 1

0

试试这个代码:

 -  (BOOL)shouldAutorotate {

UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation];

            if (orientation==UIInterfaceOrientationPortrait) {
         // do the UI changes

            }
         if(orientation==UIInterfaceOrientationLandscape){
         // do UI changes 
           }

return YES;

}
于 2013-09-28T16:14:44.213 回答