????UIButton??????????UIControl???
???????????
?????????????
????1. ????? initWithFrame
????UIButton *btn1 = [[UIButton alloc]initWithFrame:CGRectMake(10?? 10?? 80?? 44)];
???????????View??UIControl?????UIView?????????view????????????ο??????й?View?????????????
????2. UIButton ????????????????????????????buttonWithType
????UIButton *btn2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
?????????????
typedef enum {
UIButtonTypeCustom = 0??           // no button type   ????壬????
UIButtonTypeRoundedRect??          // rounded rect?? flat white button?? like in address card ????????Σ??????????????????????????
UIButtonTypeDetailDisclosure??//???????????????????κ???????
UIButtonTypeInfoLight??//???(widget)????С??????????????????κ???????
UIButtonTypeInfoDark??//????????????????????????
UIButtonTypeContactAdd??//??????(+)?????????????κ???????
} UIButtonType;
????????????????
????1.Frame????
??????2?????????????????????????frame?????????????CGRect??????????λ?ú??С
????CGRect btn2Frame = CGRectMake(10.0?? 10.0?? 60.0?? 44.0);
????btn2.frame =btn2Frame;
????2. title????
?????????κ???????μ????????????趨?e???????μ?????????setTitle ???? ???ü????
????[btn1 setTitle:@"BTN1" forState:UIControlStateNormal];
??????????????????????????????? setImage ?????
????[btn2 setImage:[UIImage imageNamed:@"pic"] forState:UIControlStateNormal];
????????????????????????????????????????????????????????? setTitleColor ?? setTitleShadowColor ????????UIColor????????????
????[btn1 setTitleColor:[UIColor redColor] forState:UIControlStateNormal];//??????????
????[btn1 setTitleShadowColor:[UIColor grayColor] forState:UIControlStateNormal ];//???
????[btn1 setBackgroundImage:[UIImage imageNamed:@"PIC"] forState:UIControlStateHighlighted];//???????
???????漸?????????? ???????? forState . ?????????????????????????????????????????????????????????????仯
enum {
UIControlStateNormal       = 0??  //???
UIControlStateHighlighted  = 1 << 0??                  // used when UIControl isHighlighted is set ????
UIControlStateDisabled     = 1 << 1??  //????
UIControlStateSelected     = 1 << 2??                  // flag usable by app (see below) ???
UIControlStateApplication  = 0x00FF0000??              // additional flags available for application use ????ó?????????
UIControlStateReserved     = 0xFF000000               // flags reserved for internal framework use  ???????????
};
typedef NSUInteger UIControlState;
????????????????????????