所以我将格兰特戴维斯先生的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;
但这会迫使所有观点都转向该特定方向。我的一些观点允许轮换,而有些则不允许。所以我想我的问题是,我怎样才能改变这条线以允许在某些视图中而不是在其他视图中旋转?今天早上我在画一个空白!!
任何帮助或想法在这里将不胜感激!