ios – 此设备不提供UIStatusBarStyleBlackTranslucent

ios – 此设备不提供UIStatusBarStyleBlackTranslucent,第1张

概述我有一个适用于iPad的UIActionSheet,它有三个选项: >取消 >相机 >图片库 当我触摸“照片库”选项时,我收到了崩溃和消息 UIStatusBarStyleBlackTranslucent is not available on this device. 我读了this post,但没弄明白. 有人能帮我吗? 更新: -(void)actionSheet:(UIActionShee 我有一个适用于iPad的UIActionSheet,它有三个选项:

>取消
>相机
>图片库

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

UIStatusbarStyleBlackTranslucent is not available on this device.

我读了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];  }}

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

解决方法 对于iPad,建议您使用popover来呈现Mediabrowser(camera / photolibrary):

UIImagePickerController *ipc = [[UIImagePickerController alloc] init];UIPopoverController *popOverController = [[UIPopoverController alloc] initWithContentVIEwController:ipc];popOverController.delegate = self;

您还可以为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];
总结

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

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

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1082644.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存