iOS-UI-用for循环铺各色小方块

iOS-UI-用for循环铺各色小方块
iOS-UI-用for循环铺各色小方块
for (CGFloat i = 0; i < 375; i+= 75) {
for (CGFloat j = 0; j < 667; j+=83.375) {
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(i, j, 375 / 5, 83.375)];
view.backgroundColor = [UIColor colorWithRed:arc4random() % 256 / 255.0 green:arc4random() % 256 / 255.0 blue:arc4random() % 256 / 255.0 alpha:1];
[self.view addSubview:view];
}
}
屏幕快照 2016-01-14 下午8.50.37.png

标签: none

添加新评论

Title - Artist
0:00