cjc e03727cf5b 省钱达人忽略pod提交 | 6 jaren geleden | |
---|---|---|
.. | ||
LBXScan | 6 jaren geleden | |
LICENSE | 6 jaren geleden | |
README.md | 6 jaren geleden |
对应的swift版本请看 : swiftScan
iOS扫码封装 objective-c版本 封装ios系统API和ZXing
模仿其他app
其他设置参数自定义效果
platform :ios, '6.0'
pod 'LBXScan',:git=>'https://github.com/MxABC/LBXScan.git'
下载后将LBXScan文件夹copy到工程中 添加预编译 pch文件 (如何添加请百度) 并在其中添加
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
否则编译会报许多错误
####模仿qq界面效果
- (void)qqStyle
{
//设置扫码区域参数设置
//创建参数对象
LBXScanViewStyle *style = [[LBXScanViewStyle alloc]init];
//矩形区域中心上移,默认中心点为屏幕中心点
style.centerUpOffset = 44;
//扫码框周围4个角的类型,设置为外挂式
style.photoframeAngleStyle = LBXScanViewPhotoframeAngleStyle_Outer;
//扫码框周围4个角绘制的线条宽度
style.photoframeLineW = 6;
//扫码框周围4个角的宽度
style.photoframeAngleW = 24;
//扫码框周围4个角的高度
style.photoframeAngleH = 24;
//扫码框内 动画类型 --线条上下移动
style.anmiationStyle = LBXScanViewAnimationStyle_LineMove;
//线条上下移动图片
style.animationImage = [UIImage imageNamed:@"CodeScan.bundle/qrcode_scan_light_green"];
//SubLBXScanViewController继承自LBXScanViewController
//添加一些扫码或相册结果处理
SubLBXScanViewController *vc = [SubLBXScanViewController new];
vc.style = style;
vc.isQQSimulator = YES;
[self.navigationController pushViewController:vc animated:YES];
}
####自定义参数部分介绍
- (void)custom
{
//设置扫码区域参数
LBXScanViewStyle *style = [[LBXScanViewStyle alloc]init];
style.centerUpOffset = 44;
//扫码框周围4个角的类型设置为在框的上面
style.photoframeAngleStyle = LBXScanViewPhotoframeAngleStyle_On;
//扫码框周围4个角绘制线宽度
style.photoframeLineW = 6;
//扫码框周围4个角的宽度
style.photoframeAngleW = 24;
//扫码框周围4个角的高度
style.photoframeAngleH = 24;
//显示矩形框
style.isNeedShowRetangle = YES;
//动画类型:网格形式,模仿支付宝
style.anmiationStyle = LBXScanViewAnimationStyle_NetGrid;
//网格图片
style.animationImage = [UIImage imageNamed:@"CodeScan.bundle/qrcode_scan_part_net"];;
//码框周围4个角的颜色
style.colorAngle = [UIColor colorWithRed:65./255. green:174./255. blue:57./255. alpha:1.0];
//矩形框颜色
style.colorRetangleLine = [UIColor colorWithRed:247/255. green:202./255. blue:15./255. alpha:1.0];
//非矩形框区域颜色
style.red_notRecoginitonArea = 247./255.;
style.green_notRecoginitonArea = 202./255;
style.blue_notRecoginitonArea = 15./255;
style.alpa_notRecoginitonArea = 0.2;
SubLBXScanViewController *vc = [SubLBXScanViewController new];
vc.style = style;
//开启只识别矩形框内图像功能
vc.isOpenInterestRect = YES;
[self.navigationController pushViewController:vc animated:YES];
}
(加载速度慢,可刷新网页)