iOS6以降、回転に大きな問題があります。すべての新しい回転メソッド(shouldAutorotate、preferredInterfaceOrientationForPresentation、supportedInterfaceOrientation)を実装しましたが、すべてのビューはまだ回転しています。面白いのは、ビューがそのサイズを維持していて、ウィンドウの残りの部分(横向き)が黒であるということです。
それは私がそれを実装する方法です、何か問題がありますか?
#pragma mark -
#pragma mark - InterfaceOrientation iOS 5
//Deprecated in iOS 6
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
#pragma mark -
#pragma mark - InterfaceOrientation iOS 6
- (BOOL)shouldAutorotate{
return NO;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
return UIInterfaceOrientationPortrait;
}
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortraitUpsideDown;
}
あなたの助けの人々に感謝します。