Indication of images selected in UIImagePicker
I created a UIImagePicker, as such:
imageListView = [[UIImagePickerController alloc] init];
imageListView.allowsImageEditing = NO;
imageListView.delegate = self;
imageListView.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
I'm writing a custom override for didFinishPickingMediaWithInfo for the image picker.
- (void)imagePickerController开发者_JAVA百科:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
UIImage* picture = [info objectForKey:UIImagePickerControllerOriginalImage];
//Do stuff relating to picture
}
As you can see, I'm overriding so UIImagePicker doesn't close after an image is selected, because I want a user to be able to choose multiple images from their photo albums. Is there a way I can give a visual indication to the user of which image they selected? For example, could I turn the selected image red or remove it from the UIImagePicker?
You need to do two things for implement multi-selection,
- set showsCameraControls to NO
- To create a fully-customized image picker for browsing the photo library, use classes from the Assets Library framework, available starting in iOS 4.0. For example, you could create a custom image picker that displays larger thumbnail images, that makes use of EXIF metadata including timestamp and location information, or that integrates with other frameworks such as Map Kit. For more information, see Assets Library Framework Reference.
精彩评论