2014-02-27 63 views

回答

0

不,你不需要修改整個應用程序。

有一些委託方法你可以做到這一點。如果你的應用有我的tabbar或導航欄see my question also answered。我會幫你的。

0

使用,如果你想在橫向模式

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 

{ 

return UIInterfaceOrientationIsLandscape(interfaceOrientation); 

} 

,如果你想在所有的方向旋轉,然後返回YES旋轉屏幕此方法;

0

我也發現同樣的疑難問題發現,shouldAutorotate功能不叫每一次,所以我改變方向綱領性

首次導入這個

#import <objc/message.h> 

然後

-(void)viewDidAppear:(BOOL)animated 
{ 

    if(UIDeviceOrientationIsPortrait(self.interfaceOrientation)){ 
     if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) 
     { 
      objc_msgSend([UIDevice currentDevice], @selector(setOrientation:), UIInterfaceOrientationLandscapeLeft); 


     } 
    } 

} 

希望這對你有幫助。

相關問題