3
다음 코드를 사용하여 앨범에서 이미지를 가져 왔습니다.앨범의 사진을 프로그래밍 방식으로 보는 방법?
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[imagePicker setDelegate:self];
[self presentModalViewController:imagePicker animated:YES];
및
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
[picker dismissModalViewControllerAnimated:YES];
[picker release];
// Edited image works great (if you allowed editing)
//myUIImageView.image = [info objectForKey:UIImagePickerControllerEditedImage];
// AND the original image works great
//myUIImageView.image = [info objectForKey:UIImagePickerControllerOriginalImage];
// AND do whatever you want with it, (NSDictionary *)info is fine now
//UIImage *myImage = [info objectForKey:UIImagePickerControllerEditedImage];
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
[customImageView setImage:image];
customImageView.contentMode = UIViewContentModeScaleAspectFill;
}
하지만 난 장치로부터 어떤 응답을하지 않았다. 나는 모든 대답을 통해 갔지만 나를 위해 작동하지 않습니다. 누구든지 사진 앨범에서 이미지를 가져 오는 방법을 알려줄 수 있습니까?
나는이 코드를 내 프로젝트에서 사용했지만 앨범에서 이미지 가져 오기 버튼을 누르면 앨범을로드하는 데 아무런 징후가 보이지 않지만 계속 버튼을 누르면 계속됩니다. "최대 5 개 이상의 필터링 된 앨범 목록을 등록하려고하는데 다음 오류가 표시됩니다. 실패합니다." – surendher