我正在开发我的第一个iOS应用程序。这是一个简单的标签栏导航应用程序与自定义按钮链接到照片库。MWPhotoBrowser在选项卡栏导航应用程序中不旋转到风景
该应用程序使用MWPhotoBrowser库的库功能。
该画廊完美的作品,除了它不旋转到风景方向。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
NSLog(@"ShouldAutoRotate CALLED! - The FIELD");
return YES;}
- (IBAction)showRenderings:(id)sender {
NSMutableArray *photos = [[NSMutableArray alloc] init];
MWPhoto *photo;
photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"field_rendering_1" ofType:@"jpg"]];
photo.caption = @"The Field Rendering 1";
[photos addObject:photo];
photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"field_rendering_2" ofType:@"jpg"]];
photo.caption = @"The Field Rendering 2";
[photos addObject:photo];
photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"field_rendering_3" ofType:@"jpg"]];
photo.caption = @"The Field Rendering 3";
[photos addObject:photo];
_photos = photos;
// Create MWPhotoBrowser
MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self];
browser.displayActionButton = YES;
browser.wantsFullScreenLayout = YES;
[browser setInitialPageIndex:0];
[self.navigationController pushViewController:browser animated:YES];
}
我在我的视图控制器和MWPhotoBrowser检查了所有- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
。他们都返回YES。
为什么MWPhotoBrowser不能旋转到Landscape Orientation?
有同样的问题。然而,我做了一个例子,并直接从AppDelegate运行它,它的工作。当把它整合到另一个课堂时,突然它不能转动到景观。你是否也测试过这种情况? – user373455