2015-06-25 46 views
1

我已經爲iPad的應用程序,該應用程序是唯一的風景左右orientation..like PRINTSCREEN:iPad應用程序風景模式破碎的iOS 8.3

The app is only landscape orientation

,我使用下面的代碼旋轉視圖,以風景模式:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight]; 
CGAffineTransform rotate = CGAffineTransformMakeRotation(M_PI/2); 
    [self.window setTransform:rotate]; 
    [self.window setFrame:CGRectMake(0, 0, 768, 1024)]; 
} 

和XIB:

The xib

它工作得很好..但現在在iOS 8.3中不起作用。看來錯了......看到圖像:

enter image description here

回答

0

設置的自動佈局約束你的viewController對象。 沒必要寫這篇您在didFinishLaunchingWithOptions

[[UIApplication sharedApplication]setStatusBarOrientation:UIInterfaceOrientationLandscapeRight]; 
CGAffineTransform rotate = CGAffineTransformMakeRotation(M_PI/2); 
[self.window setTransform:rotate]; 
[self.window setFrame:CGRectMake(0, 0, 768, 1024)]; 
+0

代碼和XIB我設置方向在橫向寬度和高度1024 768? – Ladessa

+0

[self.window setFrame:[[UIScreen mainScreen] bounds]]; –

相關問題