ある時点で立ち往生した何かを実装しようとしています。
次のように、向きの制限が必要です。
iPhone 4、4S、5、5S、および 6 の場合 - 縦向きのみ
iPhone 6 Plusの場合 - 縦向きと横向きの両方
iPad の場合 - 縦向きと横向きの両方
コーディングのすべての組み合わせを試しました。最後に、iOS 8のソリューションを入手しました
**(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window // iOS 6 autorotation fix
{**
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){
if ([[UIScreen mainScreen] respondsToSelector: @selector(scale)])
{
if(IS_IPHONE_4_AND_OLDER){
printf("Device Type : iPhone 4,4s ");
return UIInterfaceOrientationMaskPortrait;
}
else if(IS_IPHONE_5){
printf("Device Type : iPhone 5,5S/iPod 5 ");
return UIInterfaceOrientationMaskPortrait;
}
else if(IS_IPHONE_6){
printf("Device Type : iPhone 6 ");
return UIInterfaceOrientationMaskPortrait;
}
else if(IS_IPHONE_6P){
printf("Device Type : iPhone 6+ ");
return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortrait;
}
}
return UIInterfaceOrientationMaskPortrait;
}
else{
printf("Device Type : iPad");
return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortrait;
}
}
上記のコードを使用して、iOS 8で管理していますが、iOS 7以下では機能しません
これを解決するのを手伝ってください...
ありがとうございました