我在一个视图上有 42 个自定义按钮。我怎样才能通过按其中任何一个来编辑我想要的已创建按钮。
int a=0; int b=1;
int otstup=10;
for (int i=1; i<=42; i++) {
CGRect frameBtn = CGRectMake(a+60+otstup, b+otstup, 45, 45);
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setFrame:frameBtn];
[button setBackgroundImage:[UIImage imageNamed:@"EmptyCoin.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(pressBtn:) forControlEvents:UIControlEventTouchUpInside];
[button setTag:i];
[self.view addSubview:button];
a=a+50;
if (i%7 == 0)
{
a=0;
b=b+45;
}
}