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 ...
随机推荐
- Diango 一——URL
内容概要 1.web框架初识 2.MTV模式 3.Django创建流程和命令行工具 4.配置文件 settings 5.视图函数 views 6.路由系统 URL 7.模板系统 templat ...
- Selenium WebDriver- 通过源码中的关键字找到我们要操作的句柄,用于多个窗口之间切换
#encoding=utf-8 import unittest import time from selenium import webdriver from selenium.webdriver i ...
- MyBatis拦截器打印不带问号的完整sql语句方法
/* Preparing: SELECT * FROM tb_user WHERE id = ? AND user_name = ? 目标是打印:SELECT * FROM tb_user WHER ...
- selenium2.53用45以下的火狐别太高
selenium2.53用45以下的火狐别太高在高的火狐需要selenium3
- Leetcode 450.删除二叉搜索树的节点
删除二叉搜索树的节点 给定一个二叉搜索树的根节点 root 和一个值 key,删除二叉搜索树中的 key 对应的节点,并保证二叉搜索树的性质不变.返回二叉搜索树(有可能被更新)的根节点的引用. 一般来 ...
- DB2 和 有道词典冲突: A communication error has been detected. Communication protocol being used: Reply.fill().
我在本机安装了DB2 9.5. 使用java jdbc连接,一直没有问题. QC for db2 连接 也一直没有问题. 突然有一天 Java程序连接 报错: A communication erro ...
- Android金额输入EditText共通方法
代码改变世界 EditText输入框实现最多到小数点后两位(金额显示) package com.lianpos.util; import android.text.Editable; import a ...
- UITabBarController支持旋转
1.默认的UITabBarController不支持四个方向,但可以给UITabBarController增加一个类别,实现旋转:具体做法: 在工程添加一个.h和.m文件如下: //Rotation. ...
- python多进程(multiprocessing)
最近有个小课题,需要用到双进程,翻了些资料,还算圆满完成任务.记录一下~ 1.简单地双进程启动 同时的调用print1()和print2()两个打印函数,代码如下: #/usr/bin/python ...
- [CODEVS1917] 深海机器人问题(最小费用最大流)
传送门 [问题分析] 最大费用最大流问题. [建模方法] 把网格中每个位置抽象成网络中一个节点,建立附加源S汇T. 1.对于每个顶点i,j为i东边或南边相邻的一个节点,连接节点i与节点j一条容量为1, ...