
iOS笔记
疾风哥哥
I'm a a a a b b b beatbox...
展开
-
图片数组形成动画(UIImageView)
图片数组形成动画(UIImageView) UIImage *image = [UIImage imageNamed:@"iphone"]; //创建UIImageView来显示图片 self.firstImageView = [[UIImageView alloc] initWithImage:image]; self.firstImageVi原创 2015-11-21 11:24:30 · 575 阅读 · 0 评论 -
iOS之关灯小游戏
先创建一对ViewController文件,用来编写开灯关灯的实现 LightViewController.h LightViewController.m在.h文件里定义两个属性,一个line:灯的行数,col:灯的列数 @property(assign, nonatomic)NSInteger line; @property(assign, nonatomic)NSInteger col;原创 2015-11-21 12:04:04 · 436 阅读 · 0 评论 -
利用touches方法拖动视图移动
拖动视图-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ NSLog(@"摸我了"); self.backgroundColor = [UIColor colorWithRed:arc4random() % 256 / 255.0 green:arc4random() % 256 /255.原创 2015-11-21 11:26:04 · 320 阅读 · 0 评论 -
UIButton控件
UIButton控件UIButton *myButton = [UIButton buttonWithType:UIButtonTypeCustom];//创建一个自定义的Button,Custom(自定义)Button属性添加点击事件/移除按钮的点击事件addTarget/removeTargetsetImage: forState: 设置指定原创 2015-11-21 11:20:22 · 260 阅读 · 0 评论 -
iOS之拼图小游戏
首先找到这8张图片,还需要一张空白的图片,自己随便剪一张吧。 定义三个属性:button可变数组,图片可变数组,正确顺序的图片数组。@property(retain, nonatomic)NSMutableArray *buttonArray;@property(retain, nonatomic)NSMutableArray *a;@property(retain, nonatomic)NS原创 2015-11-21 15:06:12 · 585 阅读 · 1 评论