Para métodos diferentes controladores de paisaje y diseño del retrato utilización vista como
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation;
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;
Si crea la vista personalizada en función de la orientación actual, comprobar esta orientación por UIDeviceOrientationDidChangeNotification
notificación y escriben código apropiado.
en uno de los métodos init~
:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didChangedOrientation:) name:UIDeviceOrientationDidChangeNotification object:nil];
Y la acción
- (void) didChangedOrientation:(NSNotification *)sender{
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
if (UIDeviceOrientationIsPortrait(orientation)){}}
hasta ahora, ¿cuál es la mejor solución para este señor ? –