IOS7-UIImagePickerController使用
来源:互联网 发布:淘宝开店装修店铺 编辑:程序博客网 时间:2024/05/16 14:13
@interface CapturePicViewController ()<UINavigationControllerDelegate,UIImagePickerControllerDelegate>@property(nonatomic,retain) UIImagePickerController *imgPickerCtl;@end@implementation CapturePicViewController@synthesize imgPickerCtl;- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self;}- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. [self loadImgPicker]; }- (void)loadImgPicker{ imgPickerCtl = [[UIImagePickerController alloc]init];
//调用摄像头捕捉图片显示出来 //Camera imgPickerCtl.sourceType = UIImagePickerControllerSourceTypeCamera;
//读取相册的图片显示出来 //photo library //imgPickerCtl.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; imgPickerCtl.delegate = self;}- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [self presentViewController:imgPickerCtl animated:YES completion:nil];}- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{ [imgPickerCtl dismissViewControllerAnimated:YES completion:^{ UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; imageView.image = [info objectForKey:UIImagePickerControllerOriginalImage]; [self.view addSubview:imageView]; }];}
0 0
- IOS7-UIImagePickerController使用
- 使用UIImagePickerController
- UIImagePickerController使用
- UIImagePickerController使用
- UIImagePickerController使用
- UIImagePickerController使用
- UIImagePickerController使用
- UIImagePickerController使用
- UIImagePickerController使用
- UIImagePickerController使用
- IOS7 UIImagePickerController 的 status bar hid
- iOS使用UIImagePickerController
- UIImagePickerController属性与使用
- UIImagePickerController的简化使用
- ios--摄像头使用--UIImagePickerController
- UIImagePickerController的简单使用
- UIImagePickerController的使用
- 在Swift使用UIImagePickerController
- 各方各个威锋网撒的发斯丹发大水
- 织梦自定义表单如何取出一个字段的值,并形成option
- 如何时间时是活笑:霉
- 41563143525
- Asterisk 模拟线路反极信号问题
- IOS7-UIImagePickerController使用
- 玩转Excel
- 明何-测试
- mybatis注解问题
- 如何页的他器归正秆
- 告诉告诉不水电费告诉水电费公司的
- 阻止iOS Web APP中点击链接跳转到Safari 浏览器新标签页
- is_callable — 检测参数是否为合法的可调用结构
- 合格分各个无色范围广东方卫视个人无色