我正在尝试使用ELCImagePickerController
,它有效,但我有一些我想改变的事情。
我希望它能够立即向我展示主要专辑的图像矩阵,而无需挑选专辑和内容。只需显示一个矩阵,并带有done
按钮。现在它可以让你先选择一个专辑。
我无法理解保存的所选图片到底在哪里?
如何更改按钮cancel
和done
图片?
这是我如何添加它(到cocos2d场景)
albumController = [[ELCAlbumPickerController alloc] initWithNibName:@"ELCAlbumPickerController" bundle:[NSBundle mainBundle]];
elcPicker = [[ELCImagePickerController alloc] initWithRootViewController:albumController];
[albumController setParent:elcPicker];
[elcPicker setDelegate:self];
[[[CCDirector sharedDirector] view] addSubview:elcPicker.view];
这是完成按钮:
- (void)elcImagePickerController:(ELCImagePickerController *)picker didFinishPickingMediaWithInfo:(NSArray *)info
{
//[self removeFromParentAndCleanup:YES];
for (UIView *v in [scrollview subviews])
{
[v removeFromSuperview];
}
CGRect workingFrame = scrollview.frame;
workingFrame.origin.x = 0;
for(NSDictionary *dict in info)
{
UIImageView *imageview = [[UIImageView alloc] initWithImage:[dict objectForKey:UIImagePickerControllerOriginalImage]];
[imageview setContentMode:UIViewContentModeScaleAspectFit];
imageview.frame = workingFrame;
[scrollview addSubview:imageview];
[imageview release];
workingFrame.origin.x = workingFrame.origin.x + workingFrame.size.width;
}
[scrollview setPagingEnabled:YES];
[scrollview setContentSize:CGSizeMake(workingFrame.origin.x, workingFrame.size.height)];
}