//总列数
int totalColumns=; CGFloat appW = ;
CGFloat appH = ; //间隙
CGFloat maginX = (self.view.frame.size.width - totalColumns*appW)/(totalColumns+);
CGFloat maginY = ; for (int i=; i<self.plistData.count; i++) { UIView * appView = [[UIView alloc] init];
appView.backgroundColor=[UIColor redColor]; CGFloat col = i%totalColumns;
CGFloat row = i/totalColumns; CGFloat appX =col*(appW+maginX)+maginX;
CGFloat appY= row*(appH+maginY)+maginY; appView.frame=CGRectMake(appX, appY,appW, appH);
[self.view addSubview:appView];
}