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 ...
随机推荐
- 实践自己的WebSite______流水
尝试从头至尾搭建一个MVC的网站,主要以流水的方式进行进度和记录,而不讨论技术的部分. 1,在Controller下创建两个文件夹,分别为sys和Business,分别对应于系统功能和业务逻辑.比如登 ...
- THUSC2019游记
Day 0 完全没有明明是最后一次机会的紧张感.大概是滚粗的预兆. 住在西郊.房间好小. 和thupc前一样又有一场cometoj,好像又有小裙子了.upd:改成星空棒棒糖! Day 1 早餐有点棒. ...
- c#利用反射实现对类中的常量进行取值和对应常量的注释
C#利用反射实现对类中的常量进行取值和对应常量的注释 项目示例:https://gitee.com/dhclly/IceDog.GenerateErrorCode 因为业务需要,项目中有大量的错误码, ...
- nuc 第二届山西省大学生程序设计大赛 魔力手环
problem 很妙啊--发现状态转移矩阵每一行都可以由上一行平移得到,每次只算第一行然后平移,\(O(n^3)\) 就变成了 \(O(n^2)\). #include <iostream> ...
- ranorex官网
youtube FQ看ranorex https://demo.glyptodon.com 虚拟机 安卓实体 ranorex 只支持 Rxbrowser 我想操作安卓机器上的chrome 所以装了 ...
- python学习-- Django model -class 主键自增问题
转自:http://blog.csdn.net/mapoor/article/details/8609660 prize_id = models.IntegerField(primary_key=Tr ...
- python常用方法总结
1.os模块的路径拼接: import os now_path=os.path.abspath(__file__)#当前运行文件的路径 print(now_path) uppeer_path=os.p ...
- 浏览器提示ERR_CONTENT_DECODING_FAILED,Gzip压缩数据无法解压
最近在页面上有个显示数据表格的功能,数据由后台传给前台JS表格插件.数据格式为JSON 由于数据量很大,就想到用GZIP压缩以后传给前台.压缩前,某个表格的数据量达到3M多,用GZIP压缩后就200K ...
- ACM程序设计选修课——1043: Radical loves integer sequences(YY)
1043: Radical loves integer sequences Time Limit: 1 Sec Memory Limit: 128 MB Submit: 36 Solved: 4 ...
- ACM程序设计选修课——1036: Hungar的菜鸟赛季(YY)
1036: Hungar的菜鸟赛季 Time Limit: 1 Sec Memory Limit: 64 MB Submit: 20 Solved: 14 [Submit][Status][Web ...