2011-05-23 50 views

回答

2

有沒有簡單的方法來在橫向模式只有一個視圖,而別人都在景觀,也不是以編程方式切換到橫向模式的簡單方法。

一種可行的方法是使用一個CGAffineTransform改變你的觀點在viewWillAppear(顯示的視圖,即權前):

- (void)viewWillAppear:(BOOL)animated; { 
    //-- Adjust the status bar 
    [UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeRight; 
    //-- Rotate the view 
    CGAffineTransform toLandscape = CGAffineTransformMakeRotation(degreesToRadian(90)); 
    toLandscape = CGAffineTransformTranslate(toLandscape, +90.0, +90.0); 
    [self.view setTransform:toLandscape]; 
} 

希望這對你的作品。

0

只有當它的模式,如果它是tabBarController的一部分,你需要支持的方向更改所有控制器

相關問題