UIStatusBarStyleBlackTranslucent在此设备上不可用 [英] UIStatusBarStyleBlackTranslucent is not available on this device

查看:383
本文介绍了UIStatusBarStyleBlackTranslucent在此设备上不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 UIActionSheet iPad,有三个选项:

I have a UIActionSheet for iPad which has three options :



  1. 相机

  2. 照片库

触摸照片库选项我会收到崩溃和讯息

When I touch the "Photo Library" option I get a crash and a message


此设备上无法使用UIStatusBarStyleBlackTranslucent。

UIStatusBarStyleBlackTranslucent is not available on this device.

我阅读,但没有想出来。

I read this post, but didn't figure it out.

有人可以帮助我吗?

更新

-(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];  
}
}  

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

I get crash in last line i.e [self presentModalViewController:imgController animated:YES];

推荐答案

你应该使用popover来呈现MediaBrowser(camera / photoLibrary):

For iPad it is recommended that you should use popover to present the MediaBrowser (camera / photoLibrary):

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

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

您也可以设置popover的内容视图:

You can also set the content view for 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];

这篇关于UIStatusBarStyleBlackTranslucent在此设备上不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆