如何使用我的iPhone / iPad应用程序生成QR码?

时间:2012-01-03 07:22:20

标签: ios ios4 qr-code

我有一些信息,如姓名,公司名称,公司网址等,使用此信息,我想为此生成QR码,那么有没有任何免费的api可用或有没有任何方法为此目的生成QR码?

2 个答案:

答案 0 :(得分:2)

有几种方法可以做到这一点。我在这个答案中放置了一个例子。

对于这个答案,我们使用的是200 x 200尺寸的QR码。有关详情see here

下面的二维码Google API

http://chart.apis.google.com/chart?cht=qr&chs=200x200&chl=MECARD

示例:

网址编码:

http://chart.apis.google.com/chart?cht=qr&chs=200x200&chl=MECARD:ORG%3AArchitect+Of+The+Capitol%2CN%3ABarack+Obama%2CTEL%3A%28202%29+224-3121%2CADR%3A1331+F+St+NW+%23+SB15+Washington%2C+DC+20004-1107%2CEMAIL%3Awww.firstgov.gov

普通网址:

http://chart.apis.google.com/chart?cht=qr&chs=200x200&chl=MECARD:ORG:Walmart Stores Inc,N:Mike Duke,电话:(479)273-4000,ADR:702 SW 8TH ST BENTONVILLE,AR 72712-6209,电子邮箱:www.walmartstores.com

答案 1 :(得分:0)

请参阅此项目包装iPhone的代码:

https://github.com/kuapay/iOS-QR-Code-Generator

Just couple of steps & you are done :
1) Attach the libz.dylib library to your target in Xcode.
2) Drag the QRDraw and libpng folder files into your project.
3) Update the Header Search path under build settings menu.

希望这足以在您的应用中进行整合。