//UIButton
/*
* UIButton 是一种常用的控件,通过点击触发相应的功能
* UIButton 的几种常用的状态
1、UIControlStateNormal 正常状态
2、UIControlStateHighlighted高亮状态
3、UIControlStateSelected选中状态 -> 当button的selected设置成yes之后才能触发
**/
// [button setTitle:@"按钮1 正常状态" forState:UIControlStateNormal];
// [button setTitle:@"按钮1 高亮状态" forState:UIControlStateHighlighted];
// [button setTitle:@"按钮1 选中状态" forState:UIControlStateSelected];
/*
* button常用的几种事件
1、UIControlEventTouchUpInside 按钮按下并抬起事件
2、UIControlEventTouchDown 按钮按下事件
*3、UIControlEventTouchDownRepeat按钮多次点击触发事件
**/
// button.layer.cornerRadius = 5.f;//设置圆角
// button.layer.borderWidth = 2.1;//设置边框宽度
// button.layer.borderColor = [UIColor lightGrayColor].CGColor;//设置边框颜色
//延迟执行方法防止按钮被快速点击或者不希望点击造成错误
[selfperformSelector:@selector(delayMethod:)withObject:button afterDelay:1];
//延迟方法 -》设置按钮为可点击状态
- (void)delayMethod:(UIButton *)button
{
button.userInteractionEnabled =YES;
}