UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(x, y, 50, 50)];
button.layer.masksToBounds = YES;
//圆角,cornerRadius的值就是正方形的内切圆半径
button.layer.cornerRadius = 25;
[button setBackgroundImage:[UIImage imageNamed:[self.name objectAtIndex:i]] forState:UIControlStateNormal];
//代码绑定方法
[button addTarget:self action:@selector(clickbutton:) forControlEvents:UIControlEventTouchUpInside];
//给按钮设置id button.restorationIdentifier = [self.name objectAtIndex:i];
[[imageviewArray objectAtIndex:n] addSubview:button];