1.完成下面的布局

 

2、分析

寻找左边的规律,每一个uiview的x坐标和y坐标。

3、实现思路

 

(1)明确每一块用得是什么view

(2)明确每个view之间的父子关系,每个视图都只有一个父视图,拥有很多的子视图。

(3)可以先尝试逐个的添加格子,最后考虑使用for循环,完成所有uiview的创建

(4)加载app数据,根据数据长度创建对应个数的格子

(5)添加格子内部的子控件

(6)给内部的子控件装配数据

 

4.一些新方法或者属性

4.1

 -(void)click
 87 {
 88     //动画标签
 89     UILabel *animalab=[[UILabel alloc]initWithFrame:CGRectMake(self.view.center.x-100, self.view.center.y+20, 200, 40)];
 90     [animalab setText:@"下载成功"];
 91     animalab.font=[UIFont systemFontOfSize:12.0];设置字体大小
 92     [animalab setBackgroundColor:[UIColor brownColor]];
 93     [animalab setAlpha:0];    透明度
 94     [self.view addSubview:animalab];
 95     
 96 //    [UIView beginAnimations:Nil context:Nil];
 97 //    [animalab setAlpha:1];
 98 //    [UIView setAnimationDuration:4.0];
 99 //    [UIView commitAnimations];
100     
101     //执行完之后,还得把这给删除了,推荐使用block动画
102     设置动画
103     [UIView animateWithDuration:4.0 animations:^{
104     [animalab setAlpha:1];
105     } completion:^(BOOL finished) {
106         //[self.view re];
107     }];
108 }