UIImagePickerViewController无法激活iOS11的相册权限,但可以加载照片和视频
问题描述:
为什么UIPickerView可以加载照片和视频没有iOS11的许可? 似乎没有任何权限警报弹窗。UIImagePickerViewController无法激活iOS11的相册权限,但可以加载照片和视频
iOS11 - GM xcode9测试4
新的空白应用:
#import "ViewController.h"
#import <AVFoundation/AVFoundation.h>
@interface ViewController() <UINavigationControllerDelegate,UIImagePickerControllerDelegate>
@end
@implementation ViewController
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
UIImagePickerController *vc = [[UIImagePickerController alloc] init];
UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = sourceType;
vc.delegate = self;
[self presentViewController:vc animated:YES completion:nil];
}
它可以轻松地访问照片库中不使用任何警报,你甚至可以将照片设置背景。 这是一个系统杆错误?或者我做错了什么?
PS:设立的info.plist下面已经:
NSPhotoLibraryAddUsageDescription
NSPhotoLibraryUsageDescription
答
它是只问一个许可的时间。如果一旦你允许它,那么你不会每次都获得警报。所以,如果你想再次检查,然后删除你的应用程序并重新安装它,你会发现警报询问权限!
+0
我这里的意思是毫无戒备,我无法不选择允许或没有,因为没有警报视图弹出,但可以访问照片库。这是新的空白应用程序。 – GhostKnow
首先删除应用程序,并重新安装,并检查 – Govaadiyo
请编辑您的问题,这是不能的UIImagePickerController UIPickerView – AshokPolu