有三个不同的button,在UIView中用一个循环显示,但是只显示了一个button。
float yButton = 50.0;
for (int i = 0; i < 2; i++) {
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
button.frame = CGRectMake(80.0, yButton + 70.0, 160.0, 40.0);
[button addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchDown];
[self.view addSubview:button];
[button setTag:i];
}
如何给Button标题设置ABC?