iOS适配各版本
2015-09-28 18:44
435 查看
1.navigationItem
View Code
if (isBeforeIOS7) { UIImagePickerController * photoPicker=[[UIImagePickerController alloc]init]; if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){ photoPicker.sourceType=UIImagePickerControllerSourceTypeCamera; photoPicker.delegate = self; [self presentViewController:photoPicker animated:YES completion:nil]; } }else { if ([self shouldPhoto]) { UIImagePickerController * photoPicker=[[UIImagePickerController alloc]init]; if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){ photoPicker.sourceType=UIImagePickerControllerSourceTypeCamera; photoPicker.delegate = self; [self presentViewController:photoPicker animated:YES completion:nil]; } }else { UIAlertView *al=[[UIAlertView alloc]initWithTitle:@"权限受限" message:@"设置-手机梵讯-隐私" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil]; [al show]; } }
View Code
相关文章推荐
- iOS bug收集
- ios编程--AVCapture编程理解
- 如何将你牛逼的iOS代码分享到CocoaPod(转)
- iOS开发之线程
- iOS开发--本地通知
- 理解iOS 8中的Self Sizing Cells和Dynamic Type
- ios 常用宏(copy)
- 如何设置 程序的未读图标标记
- github iOS源码
- iOS ShareSDK的新浪微博配置
- 很好的一篇关于xcode的学习文章
- iOS9 3D Touch iOS 教程 ShortcutItem使用
- iOS 传值问题总结
- iOS开发脚踏实地学习day17-彩票
- iOS常用第三方框架
- ios开发 -- AFNetworking用法
- 如何在LLDB下排查message sent to deallocated instance问题
- 用iOSOpenDev在Xcode里配置越狱开发环境
- ios开发日记-12 sdwebImage内存泄露
- iOS -- 图片虚化,模糊化