identifierforvendor objective-c uipopovercontroller ios6

objective c - identifierforvendor - Accidente de orientación de UIPopoverController en iOS 6



swift get uuid (5)

Esta pregunta ya tiene una respuesta aquí:

Mi programa actual solo admite orientación horizontal.

En iOS 6, se UIPopoverController en UIPopoverController .

''UIApplicationInvalidInterfaceOrientation'', razón: ''Las orientaciones admitidas no tienen una orientación común con la aplicación, y shouldAutorotate está retornando SÍ''

Permití toda la orientación para el proyecto, está funcionando bien. Sin embargo, tengo que cambiar mucho para todas las vistas solo para admitir el paisaje.

¿Hay UIOrientation otra forma fácil de corregir, UIOrientation en UIPopoverController ?


Intente agregar lo siguiente a su UIApplicationDelegate :

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { return UIInterfaceOrientationMaskAll; }

Aún puede establecer las orientaciones de interfaz compatibles en su archivo Info.plist y devolver una máscara en el método supportedInterfaceOrientations: cada controlador de vista.


Nueva subclase de UIImagePickerController y agregue estos códigos:

@property (nonatomic)NSUInteger supportedInterfaceOrientations; -(NSUInteger)supportedInterfaceOrientations{ return _supportedInterfaceOrientations; } -(BOOL)shouldAutorotate{ return YES; }

Úselo así:

if (imagePickerController==nil) { imagePickerController = [[WUIImagePickerController alloc]init];//the subclass imagePickerController.delegate = self; imagePickerController.supportedInterfaceOrientations = UIInterfaceOrientationMaskLandscapeRight;//any orientation you want to set if (popoverController==nil) { popoverController = [[UIPopoverController alloc]initWithContentViewController:imagePickerController]; } }

Quién sabe una mejor manera por favor dígame.


@interface NonRotatingUIImagePickerController : UIImagePickerController @end @implementation NonRotatingUIImagePickerController - (BOOL)shouldAutorotate { return NO; } @end UIImagePickerController *picker = [[NonRotatingUIImagePickerController alloc] init];

Use Above Code, esto funcionó para mí.


Use these delegates for orientation, - (BOOL)shouldAutorotate { return YES; } -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationLandscapeLeft; }


Tu este enlace Debes configurar tu aplicación para que sea compatible con todas las orientaciones al inicio. Haz el cambio en el delegado de la aplicación.

-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) return UIInterfaceOrientationMaskAll; else /* iphone */ return UIInterfaceOrientationMaskAllButUpsideDown; }