把UIImagePickerController作为sub view的方法
UIImagePickerController是图片选择和照相机控件。
按照这样的方法可以直接拍照:
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:imagePickerController animated:YES];
但是如果你想把它加成一个sub view,你就会发现得到的只是一个不完全的控件。
[self.view addSubview:imagePickerController.view];
解决方法就是手动调用两个初始化函数:
[imagePickerController viewWillAppear:NO];
[imagePickerController viewDidAppear:NO];
posted on 2010-07-09 22:11 VinceOniPhone 阅读(1686) 评论(0) 编辑 收藏 举报