在我们的应用中,我们必须从相册中选择一张图片。 我写了一个代码,但我有两个问题:
当它加载专辑时,我没有立刻看到它,但首先我看到我的照片库名称,而不是相册:我想要看到我的图像矩阵。
< / LI>我想让用户对他需要的一堆图像进行检查,然后将它们保存在某个地方。 我不想让他能够扩大它们(就像许多应用程序一样),只能选择。
我将如何完成这两件事?谢谢。
-(id)init
{
UIImagePickerController *picker = [[UIImagePickerController alloc]init];
picker.delegate = self;
picker.wantsFullScreenLayout = YES;
// cant use modal view in cocos2d
//[picker presentModalViewController:picker animated:YES];
[[[CCDirector sharedDirector] view] addSubview:picker.view];
return self;
}
-(void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info{
// newImage is a UIImage
newImage = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
[picker dismissModalViewControllerAnimated:YES];
[picker.view removeFromSuperview];
[picker release];
}