上一节,我们已经实现了二维码的扫描,这一节,我们利用元数据的bounds和corners实现一个可视化的扫描效果。
bounds定义了包含二维码图像的矩形,corners定义了二维码图像的实际坐标:
当摄像头和二维码图片完全对齐时,bounds和corners就是相同的。但是通常来说,几乎不可能让摄像头和二维码完全对齐。
打开ViewController.m,添加以下实例变量,用于存放所有检...
分类:
移动开发 时间:
2015-03-22 09:19:33
阅读次数:
542
UICollectionView *_collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds]; _collectionView.dataSource = self; _collectionView.de.....
分类:
其他好文 时间:
2015-03-21 16:49:11
阅读次数:
116
今天碰到一个很奇葩的问题, 调试了半天:
错误:“index 0 beyond bounds for empty array”, 意思就是说数据源数组为nil, 所以你调用直接取值自然就报错.
我叙述下我的场景:
1. 在UITaleView中创建cell, 数据源dataArray是存在并且数量为10, 然后我是[dataArray objectAtIndexindexPa...
分类:
编程语言 时间:
2015-03-20 18:48:11
阅读次数:
145
控件的属性:
二、frame,center和bounds属性
“
在iOS中,每个控件都是继承于UIView的,都会有视图的属性存在,控制这个视图的位置就有Frame和Bounds两个属性
frame指的是:该view在父view坐标系统中的位置和大小。(参照点是父亲的坐标系统)
bounds指的是:该view在本身坐标系统中 的位置和大小。(参照点是本身坐标系统)
”
1.frame、ce...
分类:
其他好文 时间:
2015-03-17 10:30:22
阅读次数:
144
TileMode是一个枚举类,位于android.graphics.Shader类里面android源码 public enum TileMode {
/**
* replicate the edge color if the shader draws outside of its
* original bounds
*/...
分类:
移动开发 时间:
2015-03-16 21:25:43
阅读次数:
199
修改UITextField高度 === --- ## 是否可以通过修改frame改变高度 网上流传的代码中使用如下一份代码: // ? ?以下代码任然不能改变UITextField高度 ? ? ????CGRect rect = _userNameField.bounds; ? ? ...
分类:
移动开发 时间:
2015-03-15 23:48:15
阅读次数:
1453
一 创建表格,并把表格添加到控制器 UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];//创建表格 指定表格的宽高为self.vi.....
分类:
其他好文 时间:
2015-03-15 21:16:08
阅读次数:
97
最近项目发现,在tableviewCell中布局使用autolayout,但是在iOS7系统运行出现没有更新布局的bug,解决办法:1.self.contentView.frame=self.bounds2.?self.contentView.bounds=CGRectMake(0,0,99999,...
分类:
移动开发 时间:
2015-03-14 10:58:08
阅读次数:
167
一个动画效果by 伍雪颖#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)@interfaceViewController ()@end@implementation ViewController- (void)viewDid...
分类:
其他好文 时间:
2015-03-13 10:31:28
阅读次数:
113
苹果API常用英语名词:0. indicating 决定1.in order to 以便2.rectangle bounds 矩形尺寸3.applied 应用4.entirety 全部5.technique 方法6.truncating 截短7.wrapping 换行8.string 字符串9.f....
分类:
移动开发 时间:
2015-03-12 00:42:36
阅读次数:
141