if ( [[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0){
                
                //check whether the permission open for user in settings
                AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
                if (authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied)
                    
                {
                    CMAlertView *alert = [[CMAlertView alloc]init];
                    [alert setAlertViewFrameWithX:self.localView.frame.size.width/8 withY:self.localView.bounds.size.height/2 withW:self.localView.frame.size.width - self.localView.frame.size.width/4 withH:100];
                    [alert setImage:@"01_login_alerticon@2x.png" withOrignalx:20 withY:30 withW:30 withH:30];
                    [alert setLabelWithText:NSLocalizedStringFromTable(@"alert_view_please_open_camera_visit_permission", @"StringInfo", nil) withX:50 withY:15 withW:180 withH:50];
                    [alert setFont:[UIFont systemFontOfSize:18.0f] withColor:[UIColor whiteColor]];
                    [alert setAlertViewBackgroundColor:[UIColor colorWithRed:68/255.0f green:153/255.0f blue:181/255.0f alpha:1.0]];
                    [alert setAlertViewDisplayType:@"Info"];
                    [alert show];
                    [alert release];
                    
                }
                else{
                    //present the camera view
                    UIImagePickerController *picker = [[UIImagePickerController alloc] init];//initial
                    self.imagePickerController = picker;
                    [picker release];
                    self.imagePickerController.delegate = self;
                    self.imagePickerController.allowsEditing = YES;//set editable
                    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){
                        self.imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
                        
                    }else{
                        
                        self.imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
                        
                        
                    }
                    [self presentViewController:self.imagePickerController animated:YES completion:nil];//enter camera
                }

ios7.1后setting中没有开启相机服务应用程序相机预览黑屏问题的更多相关文章

  1. 挑战中英实时语音翻译——Skype Translator 中文预览版登陆中国

    Translator 中文预览版登陆中国" title="挑战中英实时语音翻译--Skype Translator 中文预览版登陆中国"> 今天,我们正式宣布在中国 ...

  2. Print2flash在.NET(C#)64位中的使用,即文档在线预览

    转:http://www.cnblogs.com/flowwind/p/3411106.html Print2flash在.NET(C#)中的使用,即文档在线预览   office文档(word,ex ...

  3. Print2flash在.NET(C#)中的使用,即文档在线预览

    office文档(word,excel,ppt)在线预览查看,有很多种方式,比如可以 1.调用weboffice组件,进行word预览,要求客户端安装word,仅适用IE, word2013, IE1 ...

  4. websocketj--随时随地在Web浏览器中操作你的服务端程序

    0 - 有没有觉得Linux标准终端界面输入输出枯燥无味? 1 - 什么?vmstat命令的输出数据不直观?有没有想过能够可视化该命令的输出? 2 - 尝试过用浏览器操作Windows中的cmd吗? ...

  5. 网站中集成jquery.imgareaselect实现图片的本地预览和选择截取

    imgAreaSelect 是由 Michal Wojciechowski开发的一款非常好用的jquery插件,实现了图片的截取功能.其文档和Demo也是很详尽的.大家可以到http://odynie ...

  6. Transformer中引用iqd作为数据源的时候数据预览出现乱码

    在cognos开发利用transform建模的过程中导入iqd数据源预览乱码问题,下面先描述一下环境 操作系统版本: [root@enfo212 ~]# cat /proc/version Linux ...

  7. dev中 ,usercontrol打印界面内容,打印预览和打印

    首先,在对应的文件夹下面添加引用,如下图 如果没有就下载下来包. 预先在本地文件夹下面建立.frx文件,像这样的, 然后在触发事件下面写 //打印预览 private void btn_Preview ...

  8. JAVA 解压压缩包中指定文件或实现压缩文件的预览及下载单个或多个指定的文件

    业务逻辑中还要判读用户是否有此文件的防问权限 2017-04-20 新增文件与文件夹图标显示及过滤高亮显示功能: 2017-05-20 新增搜索向前及向后.及更新下载功能.更新文件路径显示: 测试地址 ...

  9. 升级.net core 3.x 后mvc项目调试状态编辑view代码不能实时预览

    https://stackoverflow.com/a/58126955 简单来说 需要在nuget上安装Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilati ...

随机推荐

  1. java启动的一些参数

    -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremo ...

  2. 大数据学习——spark-steaming学习

    官网http://spark.apache.org/docs/latest/streaming-programming-guide.html 1.1.  用Spark Streaming实现实时Wor ...

  3. python学习--python 连接SQLServer数据库(两种方法)

    1. python 学习.安装教程参照: http://www.runoob.com/python/python-tutorial.html 2. 集成开发环境 JetBrains PyCharm C ...

  4. Deep Android Malware Detection小结

    题目:Deep Android Malware Detection 作者:Niall McLaughlin, Jesus Martinez del Rincon, BooJoong Kang 年份:2 ...

  5. 换一种思维看待PHP VS Node.js

    php和javascript都是非常流行的编程语言,刚刚开始一个服务于服务端,一个服务于前端,长久以来,它们都能够和睦相处,直到有一天,一个叫做node.js的JavaScript运行环境诞生后,再加 ...

  6. 利用MVC模式简单设计jsp分页效果

    利用Mysql创建一个表Car 用Eclipse创建一个Dynamic Web Project 在lib目录下导入Mysql的jar包 创建如下文件 package com.bean; public ...

  7. iOS学习笔记27-摄像头

    一.摄像头 在iOS中,手机摄像头的使用有以下两种方法: UIImagePickerController拍照和视频录制 优点:使用方便,功能强大 缺点:高度封装性,无法实现一些自定义工作 AVFoun ...

  8. 只用css3实现菜单的toggle效果

    一.原理: 使用label与input来实现,label和复选框是有关联的,label的for属性对应的是input的id,所以点击label时,它就会勾选或取消复选框. 如果我们需要让菜单默认显示, ...

  9. HDU——1020Encoding(水题,string过)

    Encoding Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total S ...

  10. Codeforces963B - Destruction of a Tree

    Portal Description 给出一个\(n(n\leq2\times10^5)\)个点的树,每次可以删除一个度数为偶数的点及其相连的边,求一种能够删掉整棵树的方案. Solution 简单起 ...