IPhone UIButton 属性
2013-10-07 17:38
537 查看
http://blog.csdn.net/yan_daoqiu/article/details/7332973
UIButton状态:
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];
相关文章推荐
- IPhone UIButton 属性
- IPhone UIButton 属性
- UIButton属性
- UIButton的titleEdgeInsets和imageEdgeInsets属性
- iphone编程之UIButton用法详解
- UIButton常用属性介绍lzp
- Java 处理 iphone拍照后 图片EXIF属性翻转90度的方法
- IPhone开发学习笔记:属性变量如何release?
- iphone-common-codes-ccteam源代码 CCUIButton.m
- IOS的UITextField,UIButton,UIWebView的一些属性介绍和IOS图片资源的使用技巧
- UIButton控件属性
- 【iOS开发-8】UIButton类型属性简单归纳以及自定义按钮的设置
- iPhone UITextField 属性
- iPhone开发进阶(6)--- 编程定制UIButton
- UIButton的titleEdgeInsets和imageEdgeInsets属性
- Iphone开发(十四)深入理解scrollView的contentOffset等属性,实现下拉刷新功能
- 获取UIButton的一些属性
- 【iphone】Object-c 属性说明
- iphone 开发中属性 property 和 synthesize 权威的介绍
- iPhone UIButton图标与文字间距设置【转】