IPhone UIButton 属性
UIButton状态:
UIControlStateNormal // 正常状态
UIControlStateHighlighted // 高亮状态
UIControlStateDisabled // 禁用状态
UIControlStateSelected // 选中状态
UIControlStateApplication //
UIControlStateReserved // 保留状态
UIButton类型:
UIButtonTypeCustom //自定义类型
添加图片:
![](http://hi.csdn.net/attachment/201112/19/0_13242651598Z22.gif)
灰色背景颜色:
![](http://hi.csdn.net/attachment/201112/19/0_1324265210Ukuh.gif)
UIButtonTypeRoundedRect //圆角类型
![](http://hi.csdn.net/attachment/201112/19/0_1324265243K0Z3.gif)
UIButtonTypeDetailDisclosure //细节展示按钮
![](http://hi.csdn.net/attachment/201112/19/0_13242652649fGk.gif)
UIButtonTypeInfoLight //浅色背景的信息按钮
![](http://hi.csdn.net/attachment/201112/19/0_1324265293wBEw.gif)
UIButtonTypeInfoDark //暗色背景的信息按钮
![](http://hi.csdn.net/attachment/201112/19/0_1324265341f38O.gif)
UIButtonTypeContactAdd // 添加按钮
![](http://hi.csdn.net/attachment/201112/19/0_1324265358QtQA.gif)
创建UIButton
1. UIButton *button = [[UIButton alloc] initWithFrame: CGRectMake (x, y, Width, Height)];
2. UIButton *button = [[UIButton buttonWithType:UIButtonTypeCustom] retain];
设置UIButton标题
[button setTitle:title forState:UIControlStateNormal];
设置UIButton标题颜色
[button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
设置UIButton背景图片
[button setBackgroundImage:newImage forState:UIControlStateNormal];
设置UIButton背景颜色
button.backgroundColor = [UIColor clearColor];