2013-01-15 30 views
0

我在這裏有一個問題,我不能拿出答案,爲什麼我的應用程序是這樣的。 我使用XCode 4.5+和iOS6製作了應用程序,並將我的應用程序設置爲橫向模式下工作並運行良好,直到我試圖在iOS 5.1模擬器之類的以前版本中運行它或所有視圖均處於縱向模式(意見是在舊版本的肖像

+1

對於iOS5,您必須在您的視圖控制器中實現' - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation'方法 – tkanzakic

+0

請首先搜索iOS 6.0中有關方向更改的許多類似帖子,例如[this](http: //stackoverflow.com/questions/12404556/interface-orientation-in-ios-6-0)。 – phi

+0

@Irene我的應用程序在iOS 6中運行良好,但我無法理解爲什麼我的應用程序在低版本中處於肖像模式,而在iOS6中處於橫向模式時,我將整個應用程序設置爲橫向模式(我已設置它從我的xib文件景觀),也支持界面方向 –

回答

0

您可以嘗試在你的控制器定義這個方法:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    return (interfaceOrientation == UIInterfaceOrientationPortrait)ç 
} 

此扮演shouldAutorotate爲iOS6的同一角色

+0

謝謝塞爾吉奧它工作:) –

0

的建議通過tkanzakic - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOr‌​ientation解決了我的問題,低版本非常感謝:)。