- (IBAction)choosePhoto{ self.picker = [[UIImagePickerController alloc] init]; self.picker.delegate = self; self.picker.sourceType = UIImagePickerControllerSourceTypePhotolibrary; [self presentModalVIEwController:self.picker animated:YES];}- (voID)imagePickerControllerDIDCancel:(UIImagePickerController *)imagePicker{ NSLog(@"dismiss image picker"); [self dismissModalVIEwControllerAnimated:NO]; [[self.picker parentVIEwController] dismissModalVIEwControllerAnimated:NO]; [self.presentedVIEwController dismissModalVIEwControllerAnimated:NO]; [self.presentingVIEwController dismissModalVIEwControllerAnimated:NO]; // And every other way i Could think of}- (voID)imagePickerController:(UIImagePickerController *)imagePicker dIDFinishPickingMediawithInfo:(NSDictionary *)info{ .. same stuff here}
我试图从父,祖父母,navigationController和根控制器呈现选择器,没有任何作用.我做什么我不能解雇ImagePickerController.
请注意每次都会调用log语句.
干杯
解决方法 试试这一行.它可能适合你.[self.picker dismissModalVIEwControllerAnimated:NO];
对于iOS 6及更高版本,请使用此功能
[self.picker dismissVIEwControllerAnimated:NO completion:nil];
也可以使用此代码显示您的选择器控制器
if ([self respondsToSelector:@selector(presentVIEwController:animated:completion:)]){ [self presentVIEwController:self.picker animated:YES completion:nil];} else { //To target iOS 5.0 [self presentModalVIEwController:self.picker animated:YES];}总结
以上是内存溢出为你收集整理的ios – 关闭UIImagePickerController全部内容,希望文章能够帮你解决ios – 关闭UIImagePickerController所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)