显示UIImagePickerController

时间:2016-05-14 20:23:43

标签: ios objective-c uiimagepickercontroller

我使用此代码从库中选择图像:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc]init];
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.allowsEditing = YES;
imagePicker.delegate = self;
[self presentViewController:imagePicker animated:YES completion:^{viewLoadPhotoBg.hidden = YES;}];

我也在项目中使用左侧菜单库。出现UIImagePickerController时,左侧菜单显示在后台。我猜UIImagePickerController背景颜色很清晰,基于我的搜索,有些答案说没有办法改变背景颜色。

在显示UIImagePickerController时,我应该怎么看不到背景?

这是截图。我覆盖了左侧菜单以隐藏一些敏感信息。

enter image description here

1 个答案:

答案 0 :(得分:0)

我找到了解决方案,这很容易。昨天我无法弄明白。这是答案;

imagePicker.view.backgroundColor = [UIColor whiteColor];
imagePicker.view.alpha = 1.0;