Pour faire ce que vous voulez, vous devez manuellement faire pivoter (et redimensionner) votre vue.Il n'y a aucune propriété que vous pouvez changer pour faire facilement ce que vous souhaitez. le code pour enregistrer les événements de rotation de périphérique
- (void)viewDidLoad {
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:)
name:UIDeviceOrientationDidChangeNotification object:nil];
//Whenever the device orientation changes, orientationChanged will be called
}
- (void)orientationChanged:(NSNotification *)notification
{
UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;
//Based upon which orientation the device is in, update your View rotations.
//A simple view.transform = CGAffineTransformMakeRotation(whatever); will work well.
}
Je crois que vous devriez supprimer le shouldAutoRotateToInterfaceO orientation: fonction tout à fait. Vous devez également appeler le [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
lorsque votre vue est déchargée.