您的位置:首页 > 产品设计 > UI/UE

IPhone UIButton 属性

2013-10-07 17:38 537 查看
http://blog.csdn.net/yan_daoqiu/article/details/7332973

UIButton状态:

UIControlStateNormal//正常状态

UIControlStateHighlighted//高亮状态

UIControlStateDisabled//禁用状态

UIControlStateSelected//选中状态

UIControlStateApplication//

UIControlStateReserved//保留状态


UIButton类型:

UIButtonTypeCustom//自定义类型

添加图片:

灰色背景颜色:




UIButtonTypeRoundedRect//圆角类型





UIButtonTypeDetailDisclosure//细节展示按钮





UIButtonTypeInfoLight//浅色背景的信息按钮





UIButtonTypeInfoDark//暗色背景的信息按钮





UIButtonTypeContactAdd//添加按钮





创建UIButton

1.UIButton*button=[[UIButtonalloc]initWithFrame:CGRectMake(x,y,Width,Height)];


2.UIButton*button=[[UIButtonbuttonWithType:UIButtonTypeCustom]retain];


设置UIButton标题

[buttonsetTitle:titleforState:UIControlStateNormal];


设置UIButton标题颜色

[buttonsetTitleColor:[UIColorblackColor]forState:UIControlStateNormal];


设置UIButton背景图片

[buttonsetBackgroundImage:newImageforState:UIControlStateNormal];


设置UIButton背景颜色

button.backgroundColor=[UIColorclearColor];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: