快3网上购买

iOS调用系统照相机和相册

电脑杂谈  发布时间:2019-09-02 11:04:45  来源:网络整理

ios 打开系统相册_ios 打开相册_ios webview 打开相册

iOS 10 以后记得在plist里面添加获得拍照相册权限,iOS 10 以后记得在plist里面添加获得拍照和相册权限,iOS 10 以后记得在plist里面添加获得拍照和相册权限,iOS 10 以后记得在plist里面添加获得拍照和相册权限ios 打开相册,iOS 10 以后记得在plist里面添加获得拍照和相册权限,iOS 10 以后记得在plist里面添加获得拍照和相册权限,iOS 10 以后记得在plist里面添加获得拍照和相册权限,iOS 10 以后记得在plist里面添加获得拍照和相册权限,iOS 10 以后记得在plist里面添加获得拍照和相册权限,iOS 10 以后记得在plist里面添加获得拍照和相册权限,iOS 10 以后记得在plist里面添加获得拍照和相册权限,iOS 10 以后记得在plist里面添加获得拍照和相册权限,iOS 10 以后记得在plist里面添加获得拍照和相册权限ios 打开相册,iOS 10 以后记得在plist里面添加获得拍照和相册权限。

/**

* 调用照相机

*/

- (void)openCamera

{

UIImagePickerController *picker = [[UIImagePickerController alloc] init];

picker.delegate = self;

picker。allowsEditing = YES; //可编辑

//判断是否可以开启照相机

快3网上购买if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])

{

ios 打开系统相册_ios 打开相册_ios webview 打开相册

//

picker.sourceType = UIImagePickerControllerSourceTypeCamera;

[self presentViewController:picker animated:YES completion:nil];

}

else

{

NSLog(@"没有");

}

}

/**

* 打开相册

*/

ios 打开相册_ios webview 打开相册_ios 打开系统相册

-(void)openPhotoLibrary

{

// Supported orientations has no common orientation with the application, and [PUUIAlbumListViewController shouldAutorotate] is returning YES

// 进入相册

if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary])

{

快3网上购买UIImagePickerController *imagePicker = [[UIImagePickerController alloc]init];

imagePicker.allowsEditing = YES;

imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

imagePicker.delegate = self;

[self presentViewController:imagePicker animated:YES completion:^{

NSLog(@"打开相册");

ios 打开相册_ios 打开系统相册_ios webview 打开相册

}];

}

else

{

NSLog(@"不能打开相册");

}

}

快3网上购买#pragma mark - UIImagePickerControllerDelegate

// 拍照完成回调

快3网上购买- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(nullable NSDictionary *)editingInfo NS_DEPRECATED_IOS(2_0, 3_0)

{

NSLog(@"finish。。");

ios 打开相册_ios 打开系统相册_ios webview 打开相册

if(picker。sourceType == UIImagePickerControllerSourceTypeCamera)

{

//图片存入相册

UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);

}

快3网上购买[self dismissViewControllerAnimated:YES completion:nil];

}

//进入拍摄页面单击更改按键

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker

{

[self dismissViewControllerAnimated:YES completion:nil];

}


本文来自电脑杂谈,转载请注明本文网址:
http://www.kadakong.com/a/ruanjian/article-121436-1.html

    相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    • 刘城金
      刘城金

      舍不得再怎么不舍终究还是要舍得

    北京快3 快三平台 万发彩票官网 冠军彩票开奖 万发彩票开奖 必发彩票开户 恒彩彩票计划 快3投注官网 万发彩票官网 福建11选5