私のプロジェクトでは、縦方向の回転のみを許可しましたが、ViewController横方向も有効にしたいと考えています。私はこれViewControllerを として提示しています。メソッドまたは iOS 6 メソッドModalViewControllerを使用してみましたが、実際には何も機能しませんでした。これらのメソッドが呼び出されたにもかかわらず、ビューは回転しませんでした。- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation-(NSUInteger) supportedInterfaceOrientations
この後、私はそれらの通知を聞いて mysref で回転させようとしました:
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didRotate:)
name:UIDeviceOrientationDidChangeNotification
object:nil];
しかし、viewin メソッドを手動で回転させることはできましたが、didRotate非常に面倒で、. を回転させることはできませんStatusBar。
のような標準的な方法を使用したいshouldAutorotateToInterfaceOrientationのですが、方法がわかりません。誰?