SYBarcodeManager二维码的扫描与生成
2017-09-22 14:17
176 查看
SYBarcodeManager
代码示例
代码示例
代码示例
// 导入头文件 #import "SYBarcodeManager.h" // 实例化 SYBarcodeManager *scanningBarcode = [[SYBarcodeManager alloc] init]; // 属性设置 scanningBarcode.scanRadius = 50.0; scanningBarcode.showScanline = YES; scanningBarcode.scanlineColor = [UIColor redColor]; scanningBarcode.showScanCorner = YES; scanningBarcode.scanCornerColor = [UIColor greenColor]; // 方法调用 // 首次调用扫描二维码 [scanningBarcode barcodeScanningWithFrame:CGRectMake(60.0, (CGRectGetHeight(self.view.bounds) - (CGRectGetWidth(self.view.bounds) - 60.0 * 2)) / 2, (CGRectGetWidth(self.view.bounds) - 60.0 * 2), (CGRectGetWidth(self.view.bounds) - 60.0 * 2)) view:self.view complete:^(NSString *scanResult) { [[[UIAlertView alloc] initWithTitle:nil message:scanResult delegate:nil cancelButtonTitle:nil otherButtonTitles:@"ok", nil] show]; }]; // 停止扫描二维码 [scanningBarcode barcodeScanningCancel]; // 重新扫描二维码 [scanningBarcode barcodeScanningStart];
代码示例
// 指定大小和颜色 CGFloat width = (CGRectGetWidth(self.view.bounds) - 10.0 * 2); UIImage *image = [SYBarcodeManager barcodeImageWithContent:@"https://github.com/potato512/BarcodeManager" size:width colorRed:10.0 colorGreen:100.0 colorBlue:50.0]; // 指定大小 CGFloat width = (CGRectGetWidth(self.view.bounds) - 10.0 * 2); UIImage *image = [SYBarcodeManager barcodeImageWithContent:@"https://github.com/potato512/BarcodeManager" size:width];
相关文章推荐
- HTML5实现扫描识别二维码/生成二维码
- ios7后二维码的生成与扫描(需要注意滤镜的模糊度问题)
- Ionic3 生成项目及扫描二维码
- Android扫描二维码及生成二维码Demo
- 二维码的扫描和生成原生实现
- 使用zxing生成QRCode二维码,在Android的webview中调用条形码扫描(转)
- android 二维码 扫描与生成(内置)
- iOS中 扫描二维码/生成二维码详解
- IOS扫描链接生成的二维码,window.history.go(-1);window.history.back()代码不生效
- 扫描二维码和生成二维码
- iOS二维码的生成和扫描
- iOS中 扫描二维码/生成二维码具体解释 韩俊强的博客
- cocos2dx-lua在ios上实现生成及扫描二维码
- 二维码的 扫描 扫描本地图库 生成一个二维码
- android二维码的生成和扫描
- iOS开发--二维码/条形码(扫描(可区域)和生成)
- Cordova各个插件使用介绍系列(二)—$cordovaBarcodeScanner扫描二维码与生成二维码
- iOS二维码生成、识别、扫描等
- zxing for javascript 扫描二维码和生成二维码
- 二维码的扫描和生成