IPhone UIButton 属性
2012-03-08 15:13
253 查看
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 属性
- iPhone开发之UIView中的动画属性
- iPhone UITextField 属性
- 适应移动端 iPhone & Android 微信页面的一些css属性
- 归纳笔记02:UILabel和UIButton属性
- UIButton 方法以及属性
- iPhoneUIText Field组件的文本字段属性
- UILabel和UIButton的属性
- iPhone开发之获得通讯录中联系人的所有属性
- [iPhone开发之控件的使用]UILabel的各种属性与方法的使用
- iPhone开发--UIButton中文字对齐的问题
- 5.iPhone研修(UIButton)-1
- iOS开屏滚动视图、适配iPhone X导航栏、超强UIButton封装、仿探探UI等源码
- IOS开发笔记--UIButton类型属性简单归纳以及自定义按钮的设置
- UIButton的基本属性和方法
- UITextField和UIButton属性
- iPhone UIButton图标与文字间距设置【转】
- UIView的常见属性和代码创建UIButton
- IOS UIButton的属性总结