2012-02-12 9 views
1

私はGrant Davis氏のFGalleryをフォトギャラリー用のアプリに取り込んでいます。それは私の他のビューのすべての私の回転メソッドをオーバーライドしている以外は素晴らしい作品と私​​は私の人生のためにそれを停止する方法を見つけることはできません。ここでギャラリーを扱うFGalleryのFGalleryViewControllerからの抜粋です:FGalleryは他のビューのすべてのローテーションメソッドをオーバーライドしています

@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; 

が、それはその特定の方向にすべてのビューを強制します。私の見解の中にはローテーションを許すものもあれば、そうでないものもあります。だから私は私の質問は、どのようにいくつかのビューではなく、他のビューで回転を許可するには、この行を変更することができますか?私は今朝空白を描いているよ!

ここにご協力いただければ幸いです。

答えて

2

私は先に進んで自分の質問に答えるつもりです。うまくいけば、これはそれを必要としていることが他の誰かを助け

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 

@implementation 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; 
} 


- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration 
{ 
    // see if the current controller in the stack is a gallery 
    if([self.visibleViewController isKindOfClass:[FGalleryViewController class]]) 
    { 
     FGalleryViewController *galleryController = (FGalleryViewController*)self.visibleViewController; 
     [galleryController resetImageViewZoomLevels]; 
    } 
} 

@end 

およびコール:

答えは回転をオーバーライドするコードを削除することです。

関連する問題