Ajouter ci-dessous donne le code dans votre viewDidLoad INIT ou
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(deviceOrientationDidChange:) name: UIDeviceOrientationDidChangeNotification object: nil];
En fonction deviceOrientationDidChange vous obtiendrez l'orientation de l'appareil, selon ce que vous pouvez mettre à jour votre vue
- (void)deviceOrientationDidChange:(NSNotification *)notification {
//Obtain current device orientation
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
//Do my thing
}
Que voulez-vous dire par UIView seul? – ezcoding
affichage seulement ... pas une vueController –
Avez-vous besoin de faire pivoter la vue, lorsque l'orientation de votre appareil change? – ezcoding