我正在開發應用程序並在Xcode 5上開發。應用程序適用於從iOS 5到iOS 7的iPad支持。我將應用限制在左側和右側,這是在plist和項目設置中定義的。 此外,通過代碼 在應用程序委託在Xcode 5中限制iOS 5橫版的自動旋轉
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return UIInterfaceOrientationMaskLandscape;
}
定義在類
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
}
但是發生了什麼事,它工作正常,在iOS 7和iOS 6,但它總是旋轉到iOS 5時設備移動肖像。我卡在這裏如何限制這隻在景觀。請幫助我。提前致謝。
不適用於iOS 5 ... – iPatel
是...在6.0之後棄用它。 – KethanKumar
抱歉沒有工作!!!! :( – josh