如题,可以的话顺便放好位置,按钮宽75,高122。谢谢
解决方案
20
for(int i = 0; i<2; i++)
{
for(int j = 0; j<3; j++)
{
UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; //绘制形状
// 确定宽、高、X、Y坐标
CGRect frame;
frame.size.width = 75;
frame.size.height = 122;
frame.origin.x = j*75+5;
frame.origin.y = i*122+5;
[btn setFrame:frame];
}
}