Click the button, the display picture picker, then you can freely choose picture. Interface, there is a ImageView, when I select the picture, the selected image to the ImageView control. I know that may be used to call the following two functions.
The callback function
picture after the selected- (Void) imagePickerController: (UIImagePickerController *) picker
didFinishPickingMediaWithInfo: (NSDictionary *) info
Callback function after the user selects pictures,
- (Void) imagePickerController: (UIImagePickerController *) picker didFinishPickingImage: (UIImage *) image editingInfo: (NSDictionary *) editingInfo
How to display the ImageView in it?
Reply:
In the callback function.
[ImageView setImage: image];
Thus, imageView is your ImageView pointer.
Reply:
A seemingly impossible. Can you elaborate written. Thanks.
Reply:
- (Void) imagePickerController: (UIImagePickerController *) picker didFinishPickingImage: (UIImage *) image editingInfo: (NSDictionary *) editingInfo
{
[ImageView setImage: image];
}
imageView ImageView control is your name, if you have not named, give it an, remember the name of the binding. Not enough, then you should start when the picture is not set Picker commissioned to self, as well as to achieve the image picker inside. H file commissioned UIImagePickerControllerDelegate
Reply:
Callback after the user selects pictures- (Void) imagePickerController: (UIImagePickerController *) picker didFinishPickingMediaWithInfo: (NSDictionary *) info {
UIImage * image = [info objectForKey: UIImagePickerControllerOriginalImage];
yourImageView.image = image;
[Picker dismissModalViewControllerAnimated: YES];
}
Reply:
I have two functions called off, when I select the picture when the jump is this function,
- (Void) imagePickerController: (UIImagePickerController *) picker didFinishPickingMediaWithInfo: (NSDictionary *) info
{
/ / Here I added the [control name setImage: image];
But not to die. To the control did not show up.
}
Reply:
Oh, this is correct.
No comments:
Post a Comment