我設置了一張操作表,它可以在拍攝照片時返回3個選項(拍照,選擇圖片和取消),前置攝像頭出現並完美拍攝照片,但問題出在何時我再次拍攝一張照片,它沒有向我展示面對相機的照片,它向我展示了背面照相機。 這是代碼:前置攝像頭沒有反應的操作表
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
CustomImagePickerController *imagePicker = [[CustomImagePickerController alloc] init];
[imagePicker setDelegate:self];
[imagePicker setAllowsEditing:YES];
if(buttonIndex == 0) {
[imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera];
[imagePicker setCameraDevice:UIImagePickerControllerCameraDeviceFront];
} else if(buttonIndex == 1) {
[imagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
}
我在代碼更多的東西,但主要的操作設置在那裏。
有什麼問題嗎? 感謝
我嘗試你的代碼,它並沒有解決它:(是我使用它。我怎樣才能每次檢查? – Vergmort 2013-03-13 15:37:51
使你的'imagepicker'屬性類 – nsgulliver 2013-03-13 15:40:59
像這樣?@property(nonatomic,retain)UIImagePickerController * imagePicker ; – Vergmort 2013-03-13 15:47:55