iOS   发布时间:2022-03-30  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了ios – 此设备不提供UIStatusBarStyleBlackTranslucent大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个适用于iPad的UIActionSheet,它有三个选项:

>取消
>相机
>图片

当我触摸“照片库”选项时,我收到了崩溃和消息

我读了this post,但没弄明白.

有人能帮我吗?

更新:

-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonATindex:(NSInteger)buttonIndex {

    if (buttonIndex == 0) 
    {

        imgController = [[UIImagePickerController alloc] init];
        imgController.allowsEdiTing = YES;
        imgController.sourCEType =  UIImagePickerControllersourceTypeCamera;   
        imgController.delegate=self;
        [self presentModalViewController:imgController animated:YES];

    } 
    else if (buttonIndex == 1) 
    {
        imgController = [[UIImagePickerController alloc] init];
        imgController.sourCEType =  UIImagePickerControllersourceTypePhotoLibrary;
        imgController.delegate=self;
        [self presentModalViewController:imgController animated:YES];  
}
}@H_450_21@ 
 

我在最后一行崩溃,即[self presentModalViewController:imgController animated:YES];

解决方法

对于iPad,建议您使用popover来呈现MediaBrowser(camera / photoLibrary):

UIImagePickerController *ipc = [[UIImagePickerController alloc] init];

UIPopoverController *popOverController = [[UIPopoverController alloc] initWithContentViewController:ipc];
popOverController.delegate = self;@H_450_21@ 
 

您还可以为popover设置内容视图:

ipc.delegate = self; 
ipc.ediTing = NO;       
ipc.sourCEType = UIImagePickerControllersourceTypePhotoLibrary; 
ipc.mediaTypes =[UIImagePickerController availableMediaTypesForsourceType:ipc.sourCEType];

[popOverController presentPopoverFromRect:btnGallery.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];@H_450_21@

大佬总结

以上是大佬教程为你收集整理的ios – 此设备不提供UIStatusBarStyleBlackTranslucent全部内容,希望文章能够帮你解决ios – 此设备不提供UIStatusBarStyleBlackTranslucent所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。