编辑:我正在使用UIStoryBoard
.
我有presented
这样的:
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; //| UIImagePickerControllerSourceTypeSavedPhotosAlbum ;
imagePicker.mediaTypes = [NSArray arrayWithObjects:(NSString *) kUTTypeImage,nil];
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary])
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
{
imagePicker.allowsEditing = YES;
[self.navigationController presentViewController:imagePicker animated:YES completion:^{
}];
}
}
现在,当dissmissed
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = info[UIImagePickerControllerEditedImage];
NSLog(@"Image : %@",image);
[self dismissViewControllerAnimated:YES completion:^{
}];
}
现在view
变成如下所示fiqure
:
编辑:视图在被解雇时被推高到 20px。
编辑:这仅在 iOS 6.0 中