2012-10-25 49 views
1

嗨,我有一個應用程序,我已經設置支持的界面方向設置爲景觀(左主頁按鈕),景觀(右主頁按鈕)文件webview出現在ios6中旋轉,但它似乎很好<= ios 5.1模擬器

,並在testviewcontroller.m文件

我的代碼: -

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight); 
} 

做什麼樣的變化我必須做出它出現在iOS6的模擬器正常

感謝

找到了答案: -

if ([[UIDevice currentDevice].systemVersion floatValue] < 6.0) 
{ 
    // how the view was configured before IOS6 
    [self.window addSubview: navigationController.view]; 
    [self.window makeKeyAndVisible]; 
} 
else 
{ 
    // this is the code that will start the interface to rotate once again 
    [self.window setRootViewController: self.navigationController]; 
} 

從這個鏈接 -

IOS 6 force device orientation to landscape

,但現在隨着iOS6的另一個問題 - 點擊一個文本框不會調用鍵盤

回答

0
if ([[UIDevice currentDevice].systemVersion floatValue] < 6.0) 
{ 
    // how the view was configured before IOS6 
    [self.window addSubview: navigationController.view]; 
    [self.window makeKeyAndVisible]; 
} 
else 
{ 
    // this is the code that will start the interface to rotate once again 
    [self.window setRootViewController: self.navigationController]; 
} 
相關問題