我正在开发我的第一个 iOS 应用程序。这是一个简单的标签栏导航应用程序,带有链接到照片库的自定义按钮。
该应用程序将 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];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
我在我的视图控制器和 MWPhotoBrowser 中检查了所有内容。他们都返回YES。
为什么 MWPhotoBrowser 不旋转到横向?