我在滚动视图中创建了 15 个图像按钮,但只有 1 列,我想将行更改为(4 行 * 4 列)
我怎样才能做到这一点??请先给我一些,谢谢。。
NSUInteger booknumber;
for (booknumber = 1; booknumber <= 15; booknumber++) {
UIButton *button = [self createBtn:booknumber orgx:orgx orgy:orgy];
}
orgx += 100;
orgy += 0;
orgx++;
[mFavorites addSubview:button];
- (UIButton*)createBtn:(int)day orgx:(CGFloat)orgx orgy:(CGFloat)orgy{
UIButton *button=[UIButton buttonWithType:UIButtonTypeCustom];
[button setBackgroundImage:[UIImage imageNamed:@"backplane.png"] forState:UIControlStateNormal];
button.frame = CGRectMake(orgx, orgy, 75, 113);
return button;
}