UIButton详解:
一、UIButton的定义
两种创建方法
(1)常规的initWithFrame的方式
UIButton *btn1 = [[UIButton alloc]initWithFrame:CGRectMake(100, 50, 100, 75)];
[btn1 setTitle:@"close" forState:UIControlStateNormal];
btn1.backgroundColor = [UIColor greenColor];//button的背景颜色
[btn1 setBackgroundImage:[UIImage imageNamed:@"1.png"] forState:UIControlStateNormal];//button的背景图片<