调用系统的相机和相册
来源:互联网 发布:计算机机房网络维护ppt 编辑:程序博客网 时间:2024/05/17 07:28
delegate:self
cancelButtonTitle:@"取消"
destructiveButtonTitle:@"打开照相机"
otherButtonTitles:@"从手机相册获取", nil
];
as.tag=1;
[as showInView:self.view];
//actionSheet协议
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
switch (buttonIndex) {
case 0:{
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
UIImagePickerController *ipc = [[UIImagePickerController alloc]init];
[ipc setSourceType:UIImagePickerControllerSourceTypeCamera];
ipc.delegate = self;
ipc.allowsEditing = YES;
[self presentViewController:ipc animated:YES completion:nil];
}else{
NSLog(@"这设备没相机");
}
}
break;
case 1:{
UIImagePickerController *ipc = [[UIImagePickerController alloc]init];
[ipc setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
ipc.delegate = self;
ipc.allowsEditing = YES;
[self presentViewController:ipc animated:YES completion:nil];
}
break;
}
}
//选择完成
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
UIImage*image=[info objectForKey:@"UIImagePickerControllerEditedImage"];
self.sendimg=[NSMutableArray arrayWithObjects:image, nil];
[self dismissViewControllerAnimated:YES completion:^{
}];
}
//取消选择图片
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{
[self dismissViewControllerAnimated:YES completion:^{
}];
}
- 调用系统的相机和相册
- 调用系统相册和相机
- 调用系统相册和调用相机
- 相机和相册的调用
- 调用系统相册和系统相机拍照
- UIAction的使用和调用系统相册和相机
- iOS调用系统相机和相册的详细用法
- 调用系统相机相册
- 调用系统相册,相机
- 调用系统相机相册
- 调用系统相机拍照和选择相册
- iOS开发 调用系统相机和相册
- android 调用系统相机和相册
- iOS 调用系统相机和相册
- Android调用系统相机和相册
- Android调用系统相机和相册-填坑篇
- Android调用系统相机和相册
- Android调用系统相机和相册
- UITableView - 全面解析
- 编程修养(三)
- 笨办法学Python学习笔记 练习25
- db2 数据库分区
- Git忽略规则及.gitignore规则不生效的解决办法
- 调用系统的相机和相册
- ibatis $与#的区别,及排序问题
- 监听第三方键盘
- java web工作原理
- sqlzoo练习答案--The JOIN operation
- 计网-ch02-题目与解释
- VC程序播放音乐必备---mciSendString用法
- 使用jUnit和JDBC来读取数据库中的数据
- 编程修养(四)