我正在開發一個使用Worklight Studio 6.2 for iOS的混合應用程序。應用程序應該被迫橫向定位。在iOS 7中,當我調用本機頁面時,即使已將視圖控制器設置爲橫向,方向仍默認爲縱向。取向工作正常的iOS 8Worklight 6.2和iOS7中原生頁面的方向問題
我嘗試使用下面的代碼來設置本機頁面的風景,但它不工作:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}
任何幫助,將不勝感激。
謝謝你的解決方法和修復。 – adriank 2014-10-31 03:27:24