我在AppStore上有一個應用程序,它具有iPhone上的肖像模式和iPad上的縱向模式。不過,我得到的報告顯示,它在iPad 1上顯示肖像,從而摧毀了整體視圖。iPad 1顯示縱向模式而不是橫向
爲什麼iPad 1專門顯示肖像模式? iPad的版本是5.1.1
我在AppStore上有一個應用程序,它具有iPhone上的肖像模式和iPad上的縱向模式。不過,我得到的報告顯示,它在iPad 1上顯示肖像,從而摧毀了整體視圖。iPad 1顯示縱向模式而不是橫向
爲什麼iPad 1專門顯示肖像模式? iPad的版本是5.1.1
在IOS 6,用於支撐所述的方法界面方向已更改。爲了在兩個版本中支持兩種接口方向,我們需要檢查os版本並編寫代碼。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
支持新版本
- (NSUInteger)supportedInterfaceOrientations {
}
- (BOOL)shouldAutorotate {
}
在我的視圖控制器我有以下幾點:
- (NSUInteger)supportedInterfaceOrientations {
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
}
- (BOOL)shouldAutorotate {
}
轉到並確保所有視圖控制器返回它們支持的正確方向模式。我已經看到iOS 5中的這種行爲,如果我正確地記得那是原因。
我有一個非常相似的,我分辨它通過在AppDelegate.m-改變下面的代碼>的applicationDidFinishLaunching:
[self.window addSubview:self.viewController];
到
[self.window setRootViewController:self.viewController];
我看到任何方向沒有問題?我已設置景觀和iphone肖像。還有什麼可以在那裏? –