そこで、GrantDavis氏のFGalleryをフォトギャラリーのアプリに組み込みました。他のビューですべての回転方法をオーバーライドする以外はうまく機能し、一生の間、それを停止する方法を理解することはできません。ギャラリーを処理するFGalleryのFGalleryViewControllerからのスニペットを次に示します。
@implementation UINavigationController (FGallery)
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if([self.visibleViewController isKindOfClass:[FGalleryViewController class]]) {
return YES;
}
// we need to support at least one type of auto-rotation we'll get warnings.
// so, we'll just support the basic portrait.
return ( interfaceOrientation == UIInterfaceOrientationPortrait ) ? YES : NO;
}
行を変更してみました:
return ( interfaceOrientation == UIInterfaceOrientationPortrait ) ? YES : NO;
しかし、それはすべてのビューをその特定の方向に強制します。私の見解の中には回転を許可するものと許可しないものがあります。だから私の質問は、この線を変更して、一部のビューでは回転できるようにし、他のビューでは回転できないようにするにはどうすればよいかということだと思います。今朝は空白を描いています!!
ここでのヘルプやアイデアをいただければ幸いです!!