我是 xcode 的新手。在我的视图控制器中有图片库选项。用户可以标签图像来查看和添加图像。当用户单击添加新图像选项时,它的显示弹出有两个选项,如图像和相机。用户可以从图库中添加图像,也可以从相机中捕获新图像。在这种情况下,我的相机视图工作正常。然后我单击图库查看图库照片完美显示。但是当我将画廊照片视图旋转到风景时,它会自动侧向相机。这是我的问题.. 我想当手机以横向旋转照片库时,它不会横向显示相机视图。请任何人帮助我。我的代码在下面
- (void)viewWillAppear:(BOOL)animated {//
[super viewWillAppear:animated];
if (!self.disableGalleryUpdate) {
//This will replace share button in FSImageViewController share button in navigation bar
HPLBarButton *barButton = [HPLBarButton barButtonWithImage:AddNewContractor forTarget:self withSelector:@selector(addObject:)];
self.navigationItem.leftBarButtonItem = barButton;
} else {
self.navigationItem.leftBarButtonItem = nil;
}
APP_DELEGATE.screenHasMultipleOrientation = YES;
[self.navigationController setNavigationBarHidden:NO];
}
- (void)addImageClicked:(id)sender {
[[HPLImageSourceSelectionDeviceManager device] showImageSourceSelectionInView:self.view
withGalleryButtonAction:^{[self camera];}
cameraButtonActionBlock:^{[self gallery];}
];}
-(void)camera
{
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:picker animated:YES completion:nil];
}
-(void)gallery
{
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:picker animated:YES completion:nil];
}
当我在 potrait 中选择图片库视图时
和风景