Так что я недавно услышал слова от моих клиентов о странной проблеме. Экран будет черным на них, когда они попытаются повернуть свой экран. Это, похоже, вещь iOS 8 только с момента моего последнего выпуска - просто добавить iOS 8 в микс.iOS 8 autorotate поворачивает изображения с экрана
С моей ViewController:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
//
// There are 2 ways to support auto-rotation:
// - The OpenGL/cocos2d way
// - Faster, but doesn't rotate the UIKit objects
// - The ViewController way
// - A bit slower, but the UiKit objects are placed in the right place
//
#if GAME_AUTOROTATION==kGameAutorotationNone
//
// EAGLView won't be autorotated.
// Since this method should return YES in at least 1 orientation,
// we return YES only in the Portrait orientation
//
return (interfaceOrientation == UIInterfaceOrientationPortrait);
#elif GAME_AUTOROTATION==kGameAutorotationCCDirector
//
// EAGLView will be rotated by cocos2d
//
// Sample: Autorotate only in landscape mode
//
if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
[[CCDirector sharedDirector] setDeviceOrientation: kCCDeviceOrientationLandscapeRight];
} else if(interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
[[CCDirector sharedDirector] setDeviceOrientation: kCCDeviceOrientationLandscapeLeft];
}
// Since this method should return YES in at least 1 orientation,
// we return YES only in the Portrait orientation
return (interfaceOrientation == UIInterfaceOrientationPortrait);
#elif GAME_AUTOROTATION == kGameAutorotationUIViewController
//
// EAGLView will be rotated by the UIViewController
//
// Sample: Autorotate only in landscpe mode
//
// return YES for the supported orientations
return (UIInterfaceOrientationIsLandscape(interfaceOrientation));
#else
#error Unknown value in GAME_AUTOROTATION
#endif // GAME_AUTOROTATION
// Shold not happen
return NO;
}
-(BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return UIInterfaceOrientationMaskLandscape;
}
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}
Я был в состоянии воспроизвести его на устройстве, а также симулятор ....
ландшафтных Левого Портрет ландшафтного Права
Из чего я могу судить по этому поводу lar iPad, заключается в том, что изображение фактически вращается с экрана. В настоящее время я разрешаю все 4 ориентации, хотя игра в ландшафте, потому что я использую игровой центр и, по крайней мере, некоторые более старые iOS, требующие записи в портфолио. Я использую довольно старую версию cocos2d (v1.1.0-beta2b), но я никогда не испытывал ничего подобного раньше. Возможно, я могу просто изменить поддерживаемые ориентации и отключить автоматический поворот, но я хотел бы исправить это. Что тут происходит?
Работы для меня. – PWiggin
Большое вам спасибо! Я бил головой о стену, так как каждое обновление iOS ломает мое старое приложение cocos2d haha. – Arbel