ios7.1后setting中没有开启相机服务应用程序相机预览黑屏问题
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中没有开启相机服务应用程序相机预览黑屏问题的更多相关文章
- 挑战中英实时语音翻译——Skype Translator 中文预览版登陆中国
Translator 中文预览版登陆中国" title="挑战中英实时语音翻译--Skype Translator 中文预览版登陆中国"> 今天,我们正式宣布在中国 ...
- Print2flash在.NET(C#)64位中的使用,即文档在线预览
转:http://www.cnblogs.com/flowwind/p/3411106.html Print2flash在.NET(C#)中的使用,即文档在线预览 office文档(word,ex ...
- Print2flash在.NET(C#)中的使用,即文档在线预览
office文档(word,excel,ppt)在线预览查看,有很多种方式,比如可以 1.调用weboffice组件,进行word预览,要求客户端安装word,仅适用IE, word2013, IE1 ...
- websocketj--随时随地在Web浏览器中操作你的服务端程序
0 - 有没有觉得Linux标准终端界面输入输出枯燥无味? 1 - 什么?vmstat命令的输出数据不直观?有没有想过能够可视化该命令的输出? 2 - 尝试过用浏览器操作Windows中的cmd吗? ...
- 网站中集成jquery.imgareaselect实现图片的本地预览和选择截取
imgAreaSelect 是由 Michal Wojciechowski开发的一款非常好用的jquery插件,实现了图片的截取功能.其文档和Demo也是很详尽的.大家可以到http://odynie ...
- Transformer中引用iqd作为数据源的时候数据预览出现乱码
在cognos开发利用transform建模的过程中导入iqd数据源预览乱码问题,下面先描述一下环境 操作系统版本: [root@enfo212 ~]# cat /proc/version Linux ...
- dev中 ,usercontrol打印界面内容,打印预览和打印
首先,在对应的文件夹下面添加引用,如下图 如果没有就下载下来包. 预先在本地文件夹下面建立.frx文件,像这样的, 然后在触发事件下面写 //打印预览 private void btn_Preview ...
- JAVA 解压压缩包中指定文件或实现压缩文件的预览及下载单个或多个指定的文件
业务逻辑中还要判读用户是否有此文件的防问权限 2017-04-20 新增文件与文件夹图标显示及过滤高亮显示功能: 2017-05-20 新增搜索向前及向后.及更新下载功能.更新文件路径显示: 测试地址 ...
- 升级.net core 3.x 后mvc项目调试状态编辑view代码不能实时预览
https://stackoverflow.com/a/58126955 简单来说 需要在nuget上安装Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilati ...
随机推荐
- BZOJ 4369: [IOI2015]teams分组
把一个人看成二维平面上的一个点,把一个K[i]看成左上角为(0,+max),右下角为(K[i],K[i])的一个矩阵,那么可以很好地描述人对于询问是否合法(我也不知道他怎么想到这东西的) 然后把一组询 ...
- luogu3381 【模板】最小费用最大流
每次选代价最小的流增广 #include <iostream> #include <cstring> #include <cstdio> #include < ...
- bzoj3172 luogu3966 [TJOI2013]单词
蒟蒻也能写出来的AC代码!这题是AC自动机模板题.插入单词时用一个没出现过的字符隔开就行了. 一些细节请看注释 #include <iostream> #include <cstri ...
- python基础补漏-07-正则表达式
字符: . 匹配除了换行符以外的任意字符 \w 匹配字母或者数字或下划线或汉字(除了特殊字符外都能匹配) \s 匹配任意空白符 \d 匹配数字 \b 匹配单词的开始或者结束 ^ 匹配字符串 ...
- NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config的问题
故障问题: 使用springMVC3.05 ,tomcat服务器进行开发, Spring配置正确,console有输出,但是url打开时不能出现页面,提示错误信息为:NoClassDefFoundEr ...
- 【转】学习设计模式之前你必须掌握的-看懂UML类图
UML类图是UML(unified modeling language,标准建模语言)五种图示法中静态图的一种-用来描述系统中类的静态结构,不仅定义系统中的类,表示类之间的联系如关联.依赖.聚合等,也 ...
- 【Luogu】P3979遥远的国度(树链剖分)
题目链接 不会换根从暑假开始就困扰我了……拖到现在…… 会了还是很激动的. 换根操作事实上不需要(也不能)改树剖本来的dfs序……只是在query上动动手脚…… 设全树的集合为G,以root为根,u在 ...
- bzoj 4184 shallot 时间线建线段树+vector+线性基
题目大意 n个时间点 每个时间点可以插入一个权值或删除一个权值 求每个时间点结束后异或最大值 分析 异或最大值用线性基 但是线性基并不支持删除操作 我们可以对时间线建一棵线段树 离线搞出每个权值出现的 ...
- 【CF1027B】Numbers on the Chessboard(数学)
题意:给定一个n*n的矩阵与生成矩阵的方式,多次询问同一个方格内(x,y)的数字是多少 题意:浪费人生的矩阵题,找规律 #include<cstdio> #include<cstri ...
- 标准C程序设计七---115
Linux应用 编程深入 语言编程 标准C程序设计七---经典C11程序设计 以下内容为阅读: <标准C程序设计>(第7版) 作者 ...