UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
button.frame = CGRectMake(100, 100, 150, 70);
button.backgroundColor = [UIColor grayColor];
[button setTitle:@"确认" forState:UIControlStateNormal];
button.layer.cornerRadius = 20;
标题的字体大小及边框
button.titleLabel.font = [UIFont systemFontOfSize:20]
button.layer.borderWidth = 10
[button addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
设置tag值
btn.tag = 1000;
[button1 setBackgroundImage:[UIImage imageNamed:@"checked.png"] forState:UIControlStateNormal];
currentTitle用来获取当前按钮的标题
NSLog(@"%@",but.currentTitle);
if ([button.titleLabel.text isEqualToString:@"确认"])