2014年12月5日
摘要: 一、UIScrollView(1).常见属性@property(nonatomic) CGPoint contentOffset; //记录UIScrollView滚动的位置@property(nonatomic) CGSize contentSize; //内容尺寸(能滚动的范围)@propert... 阅读全文
posted @ 2014-12-05 09:48 墓厄 阅读(134) 评论(0) 推荐(0) 编辑
摘要: UIView *oneView = name[0];//2.添加到控制器的view里面去[self.view addSubview:greenView];//3.storyboard和xib的异同 1>区别 *storyboard:描述软件界面,大范围,重量级,比较适合描述软件的所有界面... 阅读全文
posted @ 2014-12-05 09:47 墓厄 阅读(487) 评论(0) 推荐(0) 编辑
摘要: 一、类扩展(class extension,匿名分类) 1.格式 @Interface 类名() { //成员变量... } //方法声明... @end 2.作用 1>写在.m文件中 2>一般用来扩充私有成员变量、@property属性、方法等二、随机数生成 1.arc4random() 会... 阅读全文
posted @ 2014-12-05 09:45 墓厄 阅读(252) 评论(0) 推荐(0) 编辑
摘要: UIViewframe:位置和尺寸 也可用center移动transform:形变一、控件的属性1.frame 1>表示控件的位置和尺寸(以父控件的左上角为坐标原点(0,0)) 2>修改这个属性,可以调整控件的位置和尺寸2.center 1>表示控件的重点(以父控件的左上角为... 阅读全文
posted @ 2014-12-05 09:44 墓厄 阅读(210) 评论(0) 推荐(0) 编辑
摘要: NSBundle一.获取图片1. NSString *path = [[NSBundle mainBundle] pathForResource:@"resourceName" ofType:@“resourceType"]; UIImage *image = [[UIImageimageW... 阅读全文
posted @ 2014-12-05 09:44 墓厄 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 1.动画(头部-开始动画)[UIView beginAnimations:nil context:nil];2.设置动画的执行时间[UIView setAnimationDuration:1.0];3.向上移动// CGPoint tempCenter = _btn.center;CGRect te... 阅读全文
posted @ 2014-12-05 09:41 墓厄 阅读(221) 评论(0) 推荐(0) 编辑
摘要: Product ->>profile1.有缓存(无法释放,参数传的是文件名)[UIImage imageNamed:@""];2.无缓存(用完就会释放,参数传的是全路径)[[UIImage alloc] initWithContentsOfFile:] 阅读全文
posted @ 2014-12-05 09:40 墓厄 阅读(225) 评论(0) 推荐(0) 编辑
摘要: id类型不能用点语法- (IBAction)run:(id)sender{ //sender.tag 错误 [sender tag]} 阅读全文
posted @ 2014-12-05 09:39 墓厄 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 1.显示图片 1>UIIMageView只能一种图片(图片默认会填充整个UIImageView)image\setImage 2>UIButton能显示2种图片 *背景(背景会填充整个UIButton)setBackgroungImage:forState: *前置(覆盖在背景上面的图片,按照之... 阅读全文
posted @ 2014-12-05 09:39 墓厄 阅读(201) 评论(0) 推荐(0) 编辑
摘要: //创建按钮 UIButton *btn = [[UIButton alloc] init]; btn.frame = CGRectMake(0, 0, 100, 100); // 设置按钮在普通状态下的属性// 设置背景图片 UIImage *normal ... 阅读全文
posted @ 2014-12-05 09:38 墓厄 阅读(247) 评论(0) 推荐(0) 编辑