zoukankan      html  css  js  c++  java
  • 使用QRCode简单生成二维码

    //

    //  ViewController.m

    //  二维码

    //

    //  Created by 123 on 16/9/4.

    //  Copyright © 2016 彭洪. All rights reserved.

    //

     

    #import "ViewController.h"

    #import "QRCodeGenerator.h"//引入库

    @interface ViewController ()

     

    @end

     

    @implementation ViewController

     

    - (void)viewDidLoad {

        [super viewDidLoad];

        self.view.backgroundColor = [UIColor whiteColor];

        [self initQRCode];

    }

     

    - (void)initQRCode {

        CGFloat w = [UIScreen mainScreen].bounds.size.width;

        NSArray *arr = @[[QRCodeGenerator qrImageForString:@"Key" imageSize:400],

                         [QRCodeGenerator qrImageForString:@"Key1" imageSize:400 Topimg:[UIImage imageNamed:@"super.jpg"]],

                         [QRCodeGenerator qrImageForString:@"Key3" imageSize:400 withPointType:QRPointRound withPositionType:QRPositionRound withColor:[UIColor redColor]]

                         ];

        for (int i=0; i<3; i++) {

            UIImageView *qr = [[UIImageView alloc] initWithFrame:CGRectMake((i%3)*w/3, 100+(i/3)*w/3, w/3, w/3)];

            qr.image = arr[i];

            [self.view addSubview:qr];

        }

    }

     

    - (void)didReceiveMemoryWarning {

        [super didReceiveMemoryWarning];

        // Dispose of any resources that can be recreated.

    }

     

    @end

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  • 相关阅读:
    hibernate关联关系(多对多)
    hibernate关联关系(一对多)
    hibernate主键生成策略
    hibernate01
    利用Struts2拦截器完成文件上传功能
    layui的CRUD案列
    Struts2的CRUD
    Git中.gitignore文件不起作用
    在 Visual Studio 中使用 Q# 进行量子编程
    Elasticsearch 搜索
  • 原文地址:https://www.cnblogs.com/PengHongMiao/p/5847296.html
Copyright © 2011-2022 走看看