1

我正在使用 UIPickerViewController 来捕捉照片,但我得到的布局如下:

在此处输入图像描述

正如您在图像中看到的 - 切换相机按钮未正确显示。

下面是我的代码

    UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
    imagePickerController.modalPresentationStyle = UIModalPresentationOverCurrentContext;
    imagePickerController.mediaTypes = @[(NSString *)kUTTypeImage];
    imagePickerController.sourceType = type;
    imagePickerController.delegate = self;
    imagePickerController.navigationBarHidden = YES;
    imagePickerController.cameraDevice = UIImagePickerControllerCameraDeviceFront;
    self.imagePickerController = imagePickerController;
    [self presentViewController:self.imagePickerController animated:YES completion:nil];

我不确定我做错了什么,请建议

谢谢

4

2 回答 2

0

我遇到了一个问题,在 iOS 7 中我的状态栏没有被隐藏。所以这就是你需要做的:首先设置view controller-based status bar appearanceNO,然后在呈现视图控制器之前添加此代码:

[[UIApplication sharedApplication] setStatusBarHidden:YES];

然后只需添加 2 个委托方法:

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    [[UIApplication sharedApplication] setStatusBarHidden:NO];
}

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
    [[UIApplication sharedApplication] setStatusBarHidden:NO];
}
于 2015-07-07T13:56:37.923 回答
0

在尝试了很多事情之后,我才知道问题出在 Pixate Framework 上。

像素问题

谢谢

于 2015-07-08T11:46:53.647 回答